Part Number Hot Search : 
07N65C 40002 PK25GB40 1N3020B P8916 FSD210BM ADP3306 LM79L05
Product Description
Full Text Search
 

To Download PIC16C433 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ? 2002 microchip technology inc. preliminary ds41139b PIC16C433 data sheet 8-bit cmos microcontroller with lin transceiver
ds41139b - page ii preliminary ? 2002 microchip technology inc. information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by updates. it is your responsibility to ensure that your application meets with your specifications. no representation or warranty is given and no liability is assumed by microchip technology incorporated with respect to the accuracy or use of such information, or infringement of patents or other intellectual property rights arising from such use or otherwise. use of microchip?s products as critical com- ponents in life support systems is not authorized except with express written approval by microchip. no licenses are con- veyed, implicitly or otherwise, under any intellectual property rights. trademarks the microchip name and logo, the microchip logo, k ee l oq , mplab, pic, picmicro, picstart and pro mate are registered trademarks of microchip technology incorporated in the u.s.a. and other countries. filterlab, micro id , mxdev, mxlab, picmaster, seeval and the embedded control solutions company are registered trademarks of microchip technology incorporated in the u.s.a. dspic, dspicdem.net, economonitor, fansense, flexrom, fuzzylab, in-circuit serial programming, icsp, icepic, microport, migratable memory, mpasm, mplib, mplink, mpsim, picc, picdem, picdem.net, rfpic, select mode and total endurance are trademarks of microchip technology incorporated in the u.s.a. and other countries. serialized quick turn programming (sqtp) is a service mark of microchip technology incorporated in the u.s.a. all other trademarks mentioned herein are property of their respective companies. ? 2002, microchip technology incorporated, printed in the u.s.a., all rights reserved. printed on recycled paper. microchip received qs-9000 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in chandler and tempe, arizona in july 1999 and mountain view, california in march 2002. the company?s quality system processes and procedures are qs-9000 compliant for its picmicro ? 8-bit mcus, k ee l oq ? code hopping devices, serial eeproms, microperipherals, non-volatile memory and analog products. in addition, microchip?s quality system for the design and manufacture of development systems is iso 9001 certified. note the following details of the code protection feature on microchip devices:  microchip products meet the specification contained in their particular microchip data sheet.  microchip believes that its family of products is one of the most secure families of its kind on the market today, when used i n the intended manner and under normal conditions.  there are dishonest and possibly illegal methods used to breach the code protection feature. all of these methods, to our know l- edge, require using the microchip products in a manner outside the operating specifications contained in microchip's data sheets. most likely, the person doing so is engaged in theft of intellectual property.  microchip is willing to work with the customer who is concerned about the integrity of their code.  neither microchip nor any other semiconductor manufacturer can guarantee the security of their code. code protection does not mean that we are guaranteeing the product as ?unbreakable.? code protection is constantly evolving. we at microchip are committed to continuously improving the code protection features of our products.
? 2002 microchip technology inc. preliminary ds41139b-page 1 PIC16C433 devices included in this data sheet:  PIC16C433 high performance risc cpu:  only 35 single word instructions to learn  all instructions are single cycle (400 ns) except for program branches which are two-cycle  operating speed: dc - 10 mhz clock input dc - 400 ns instruction cycle  14-bit wide instructions  8-bit wide data path  interrupt capability  special function hardware registers  8-level deep hardware stack  direct, indirect and relative addressing modes for data and instructions peripheral features:  integrated lin bus transceiver  wake-up on bus activity  12v battery operation for transceiver  thermal shutdown for transceiver  ground loss protection  four-channel, 8-bit a/d converter  8-bit real-time clock/counter (tmr0) with 8-bit programmable prescaler pin diagram special microcontroller features:  in-circuit serial programming? (icsp?)  internal 4 mhz oscillator with programmable cali- bration  selectable clockout  power-on reset (por)  power-up timer (pwrt) and oscillator start-up timer (ost)  watchdog timer (wdt) with its own on-chip rc oscillator for reliable operation  programmable code protection  power saving sleep mode  interrupt-on-pin change (gp0, gp1, gp3)  internal pull-ups on i/o pins (gp0, gp1, gp3)  internal pull-up on mclr pin  selectable oscillator options: - intrc: precision internal 4 mhz oscillator - extrc: external low cost rc oscillator - xt: standard crystal/resonator - hs: high speed crystal/resonator - lp: power saving, low frequency crystal cmos technology:  low power, high speed cmos eprom/ hv-cmos technology  fully static design  operating voltage range 4.5v to 5.5v  industrial and extended temperature ranges  low power consumption < 2 ma @ 5v, 4 mhz < 1 a typical standby current device memory program data ram PIC16C433 2048 x 14 128 x 8 note: pins designated ?nc? have no internal con- nection to the device. pdip, soic, windowed cerdip PIC16C433  1 2 3 4 5 6 7 18 17 16 15 14 13 12 8 9 11 10 lin nc v ss v dd av dd gp5/osc1/clkin gp4/osc2/an3/clkout gp3/mclr /v pp v bat bact v ss av ss v ss gp0/an0 gp1/an1/v ref gp2/t0cki/an2/int nc nc 8-bit cmos microcontroller with lin transceiver
PIC16C433 ds41139b-page 2 preliminary ? 2002 microchip technology inc. table of contents 1.0 general description......................................................................................................... ..................................... 3 2.0 PIC16C433 device varieties .................................................................................................. .............................. 5 3.0 architectural overview...................................................................................................... .................................... 7 4.0 memory organization ......................................................................................................... ................................ 11 5.0 i/o port .................................................................................................................... ........................................... 25 6.0 lin bus transceiver ......................................................................................................... .................................. 33 7.0 timer0 module............................................................................................................... ..................................... 37 8.0 analog-to-digital converter (a/d) module .................................................................................... ...................... 43 9.0 special features of the cpu ................................................................................................. ............................. 51 10.0 instruction set summary .................................................................................................... ................................ 67 11.0 development support........................................................................................................ ................................. 81 12.0 electrical specifications for PIC16C433 .................................................................................... ......................... 87 13.0 dc and ac characteristics.................................................................................................. ............................. 105 14.0 packaging information...................................................................................................... ................................ 111 appendix a:compatibility ....................................................................................................... ..................................... 115 index .......................................................................................................................... ............................................... 117 on-line support ................................................................................................................ .......................................... 121 systems information and upgrade hot line ....................................................................................... ........................ 121 reader response ................................................................................................................ ....................................... 122 product identification system.................................................................................................. .................................... 123 to our valued customers it is our intention to provide our valued customers with the best documentation possible to ensure successful use of your micro chip products. to this end, we will continue to improve our publications to better suit your needs. our publications will be refined and enhanced as new volumes and updates are introduced. if you have any questions or comments regarding this publication, please contact the marketing communications department via e-mail at docerrors@mail.microchip.com or fax the reader response form in the back of this data sheet to (480) 792-4150. we welcome your feedback. most current data sheet to obtain the most up-to-date version of this data sheet, please register at our worldwide web site at: http://www.microchip.com you can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page . the last character of the literature number is the version number, (e.g., ds30000a is version a of document ds30000). errata an errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for curren t devices. as device/documentation issues become known to us, we will publish an errata sheet. the errata will specify the revisi on of silicon and revision of document to which it applies. to determine if an errata sheet exists for a particular device, please check with one of the following:  microchip?s worldwide web site; http://www.microchip.com  your local microchip sales office (see last page)  the microchip corporate literature center; u.s. fax: (480) 792-7277 when contacting a sales office or the literature center, please specify which device, revision of silicon and data sheet (inclu de liter- ature number) you are using. customer notification system register on our web site at www.microchip.com/cn to receive the most current information on all of our products.
? 2002 microchip technology inc. preliminary ds41139b-page 3 PIC16C433 1.0 general description the PIC16C433 device is a low cost, high perfor- mance, cmos, fully static, 8-bit microcontroller with integrated analog-to-digital (a/d) converter and an inte- grated lin bus transceiver. the lin physical layer is implemented in hardware with a voltage range from 0v to 18v, with a 40v transient capability. the lin protocol is to be implemented in firmware, which enables flexibility with future revisions of the lin protocol. all picmicro ? microcontrollers employ an advanced risc architecture. the PIC16C433 microcontroller has enhanced core features, eight-level deep stack, and multiple internal and external interrupt sources. the separate instruction and data buses of the harvard architecture allow a 14-bit wide instruction word with the separate 8-bit wide data. the two stage instruction pipeline allows all instructions to execute in a single cycle, except for program branches, which require two cycles. a total of 35 instructions (reduced instruction set) are available. additionally, a large register set gives some of the architectural innovations used to achieve a very high performance. PIC16C433 microcontroller typically achieve a 2:1 code compression and a 4:1 speed improvement over other 8-bit microcontrollers in their class. the PIC16C433 device has 128 bytes of ram, 5 i/o pins and 1 input pin. in addition, a timer/counter is available. also a 4-channel, high speed, 8-bit a/d is provided. the 8-bit resolution is ideally suited for appli- cations requiring low cost analog interface (i.e., thermostat control, pressure sensing, etc.) the PIC16C433 device has special features to reduce external components, thus reducing cost, enhancing system reliability and reducing power consumption. the power-on reset (por), power-up timer (pwrt), and oscillator start-up timer (ost) eliminate the need for external reset circuitry. there are five oscillator configurations to choose from, including intrc preci- sion internal oscillator mode and the power saving lp (low power) oscillator mode. power saving sleep mode, watchdog timer and code protection features improve system cost, power and reliability. the sleep (power-down) feature provides a power saving mode. the user can wake-up the chip from sleep through several external and internal interrupts and resets. a highly reliable watchdog timer with its own on-chip rc oscillator provides protection against software lock- up. a uv erasable windowed package version is ideal for code development, while the cost-effective one-time- programmable (otp) version is suitable for production in any volume. the customer can take full advantage of microchip?s price leadership in otp microcontrollers, while benefiting from the otp?s flexibility. 1.1 applications the PIC16C433 microcontroller fits well in applications ranging from automotive applications to home appli- ance applications. the eprom technology makes customizing application programs extremely fast. the small footprint packages, for through hole or surface mounting, make this microcontroller series perfect for applications with space limitations. low cost, low power, high performance, ease of use and i/o flexibility make the PIC16C433 series very versatile even in areas where no microcontroller use has been consid- ered before (i.e., timer functions, replacement of glue logic and pld?s in larger systems, coprocessor appli- cations). 1.2 d evelopment support the PIC16C433 device is supported by a full featured macro assembler, a software simulator, an in-circuit emulator, a low cost development programmer and a full featured programmer. a ?c? compiler and fuzzy logic support tools are also available.
PIC16C433 ds41139b-page 4 preliminary ? 2002 microchip technology inc. notes:
? 2002 microchip technology inc. preliminary ds41139b-page 5 PIC16C433 2.0 PIC16C433 device varieties a variety of frequency ranges and packaging options are available. depending on application and production requirements, the proper device option can be selected using the information in the PIC16C433 product identi- fication system (page 123) at the end of this data sheet. when placing orders, please use that page of the data sheet to specify the correct part number. 2.1 u v erasable devices the uv erasable version, offered in windowed pack- age, is optimal for prototype development and pilot pro- grams. the uv erasable version can be erased and repro- grammed to any of the configuration modes. microchip's pro mate ? ii device programmer sup- ports the PIC16C433. third party programmers also are available; refer to the microchip third party guide (ds00104) for a list of sources. 2.2 one-time-programmable (otp) devices the availability of otp devices is especially useful for customers who need the flexibility for frequent code updates and small volume applications. the otp devices, packaged in plastic packages, per- mit the user to program them once. in addition to the program memory, the configuration bits must also be programmed. 2.3 quick-turn-programming (qtp) devices microchip offers a qtp programming service for fac- tory production orders. this service is made available for users who choose not to program a medium to high quantity of units and whose code patterns have stabi- lized. the devices are identical to the otp devices, but with all eprom locations and configuration options already programmed by the factory. certain code and prototype verification procedures apply before produc- tion shipments are available. please contact your local microchip technology sales office for more details. 2.4 serialized quick-turn programming (sqtp sm ) devices microchip offers a unique programming service where a few user defined locations in each device are pro- grammed with different serial numbers. the serial num- bers may be random, pseudo-random, or sequential. serial programming allows each device to have a unique number which can serve as an entry code, password, or id number. note: please note that erasing the device will also erase the pre-programmed internal calibration value for the internal oscillator. the calibration value must be saved prior to erasing the part.
PIC16C433 ds41139b-page 6 preliminary ? 2002 microchip technology inc. notes:
? 2002 microchip technology inc. preliminary ds41139b-page 7 PIC16C433 3.0 architectural overview the high performance of the PIC16C433 family can be attributed to a number of architectural features com- monly found in risc microprocessors. to begin with, the PIC16C433 uses a harvard architecture in which program and data are accessed from separate memo- ries using separate buses. this improves bandwidth over traditional von neumann architecture in which pro- gram and data are fetched from the same memory using the same bus. separating program and data buses also allow instructions to be sized differently than the 8-bit wide data word. instruction opcodes are 14-bits wide making it possible to have all single word instructions. a 14-bit wide program memory access bus fetches a 14-bit instruction in a single instruction cycle. a two-stage pipeline overlaps fetch and execu- tion of instructions (example 3-1). consequently, all instructions (35) execute in a single cycle (400 ns @ 10 mhz) except for program branches. the PIC16C433 can directly or indirectly address its register files or data memory. all special function regis- ters, including the program counter, are mapped in the data memory. the PIC16C433 has an orthogonal (symmetrical) instruction set that makes it possible to carry out any operation on any register using any addressing mode. this symmetrical nature and lack of ?special optimal situations? make programming with the PIC16C433 simple, yet efficient. in addition, the learn- ing curve is reduced significantly. PIC16C433 devices contain an 8-bit alu and working register. the alu is a general purpose arithmetic unit. it performs arithmetic and boolean functions between the data in the working register and any register file. the alu is 8 bits wide and capable of addition, subtrac- tion, shift and logical operations. unless otherwise mentioned, arithmetic operations are two's comple- ment in nature. in two-operand instructions, typically one operand is the working register (w register). the other operand is a file register, or an immediate con- stant. in single operand instructions, the operand is either the w register or a file register. the w register is an 8-bit working register used for alu operations. it is not an addressable register. depending on the instruction executed, the alu may affect the values of the carry (c), digit carry (dc), and zero (z) bits in the status register. the c and dc bits operate as a borrow bit and a digit borrow out bit, respectively, in subtraction. see the sublw and subwf instructions for examples.
PIC16C433 ds41139b-page 8 preliminary ? 2002 microchip technology inc. figure 3-1: PIC16C433 block diagram power-up timer oscillator start-up timer eprom program memory 13 data bus 8 14 program bus instruction reg program counter ram file registers direct addr 7 ram addr (1) 9 addr mux indirect addr fsr reg status reg mux alu w reg instruction decode & control timing generation osc1/clkin osc2/clkout mclr v dd , v ss timer0 gpio 8 8 gp4/osc2/an3/clkout gp3/mclr/v pp gp2/t0cki/an2/int gp1/an1/v ref gp0/an0 8 3 gp5/osc1/clkin 8-level stack (13-bit) 128 bytes note 1: higher order bits are from the status register. a/d watchdog timer power-on reset 4 mhz clock internal lintx linrx device program memory data memory (ram) PIC16C433 2k x 14 128 x 8 lin bus v bat bact lin bus transceiver 2k x 14
? 2002 microchip technology inc. preliminary ds41139b-page 9 PIC16C433 table 3-1: PIC16C433 pinout description name dip pin # i/o/p type buffer type description gp0/an0 13 i/o ttl/st bi-directional i/o port/serial programming data/analog input 0. can be software programmed for internal weak pull-up and interrupt-on-pin change. this buffer is a schmitt trig- ger input when used in serial programming mode. gp1/an1/v ref 12 i/o ttl/st bi-directional i/o port/serial programming clock/analog input 1/voltage reference. can be software programmed for internal weak pull-up and interrupt-on-pin change. this buffer is a schmitt trigger input when used in serial pro- gramming mode. gp2/t0cki/an2/int 11 i/o st bi-directional i/o port/analog input 2. can be configured as t0cki or external interrupt. gp3/mclr /v pp 8 i ttl/st input port/master clear (reset) input/programming voltage input. when configured as mclr , this pin is an active low reset to the device. voltage on mclr /v pp must not exceed v dd during normal device operation. can be soft- ware programmed for internal weak pull-up and interrupt- on-pin change. weak pull-up always on if configured as mclr . this buffer is schmitt trigger when in mclr mode. gp4/osc2/an3/clkout 7 i/o ttl bi-directional i/o port/oscillator crystal output/analog input 3. connections to crystal or resonator in crystal oscillator mode (hs, xt and lp modes only, gpio in other modes). in extrc and intrc modes, the pin output can be config- ured to clkout, which has 1/4 the frequency of osc1 and denotes the instruction cycle rate. gp5/osc1/clkin 6 i/o ttl/st bi-directional io port/oscillator crystal input/external clock source input (gpio in intrc mode only, osc1 in all other oscillator modes). schmitt trigger input for extrc oscilla- tor mode. lin 1 i/o hv/od high voltage bi-directional bus interface. v bat 18 p ? battery input voltage. bact 17 o ttl bus activity output pin. it is a cmos-levels representation of the lin pin. v dd 4 p ? positive supply for logic and i/o pins. v ss 3,14,16 p ? ground reference for logic and i/o pins. av dd 5 p ? analog positive supply. av ss 15 p ? analog ground. legend: i = input, o = output, i/o = input/output, p = power, ? = not used, ttl = ttl input, st = schmitt trigger input, od = open drain
PIC16C433 ds41139b-page 10 preliminary ? 2002 microchip technology inc. 3.1 clocking scheme/instruction cycle the clock input (from osc1) is internally divided by four to generate four non-overlapping quadrature clocks, namely q1, q2, q3 and q4. internally, the pro- gram counter (pc) is incremented every q1, and the instruction is fetched from the program memory and latched into the instruction register in q4. the instruc- tion is decoded and executed during the following q1 through q4. the clocks and instruction execution flow is shown in figure 3-2. 3.2 instruction flow/pipelining an instruction cycle consists of four q cycles (q1, q2, q3 and q4). the instruction fetch and execute are pipelined such that fetch takes one instruction cycle, while decode and execute takes another instruction cycle. however, due to the pipelining, each instruction effectively executes in one cycle. if an instruction causes the program counter to change (i.e., goto ), then two cycles are required to complete the instruction (example 3-1). a fetch cycle begins with the program counter (pc) incrementing in q1. in the execution cycle, the fetched instruction is latched into the instruction register (ir) in cycle q1. this instruction is then decoded and executed during the q2, q3, and q4 cycles. data memory is read during q2 (operand read) and written during q4 (destination write). figure 3-2: clock/instruction cycle example 3-1: instruction pipeline flow q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 osc1 q1 q2 q3 q4 pc osc2/clkout (extrc and pc pc+1 pc+2 fetch inst (pc) execute inst (pc-1) fetch inst (pc+1) execute inst (pc) fetch inst (pc+2) execute inst (pc+1) internal phase clock intrc modes) all instructions are single cycle, except for any program branches. these take two cycles since the fetched instruction is ?flushed? from the pipeline while the new instruction is being fetched and then executed. t cy 0t cy 1t cy 2t cy 3t cy 4t cy 5 1. movlw 55h fetch 1 execute 1 2. movwf gpio fetch 2 execute 2 3. call sub_1 fetch 3 execute 3 4. bsf gpio, bit3 (forced nop) fetch 4 flush 5. instruction @ address sub_1 fetch sub_1 execute sub_1
? 2002 microchip technology inc. preliminary ds41139b-page 11 PIC16C433 4.0 memory organization 4.1 program memory organization the PIC16C433 has a 13-bit program counter capable of addressing an 8k x 14 program memory space. for the PIC16C433, the first 2k x 14 (0000h-07ffh) is implemented. accessing a location above the physi- cally implemented address will cause a wraparound. the reset vector is at 0000h and the interrupt vector is at 0004h. figure 4-1: PIC16C433 program memory map and stack 4.2 data memory organization the data memory is partitioned into two banks, which contain the general purpose registers and the special function registers. bit rp0 is the bank select bit. rp0 (status<5>) = 1 bank 1 rp0 (status<5>) = 0 bank 0 each bank extends up to 7fh (128 bytes). the lower locations of each bank are reserved for the special function registers. above the special function regis- ters are general purpose registers implemented as static ram. both bank 0 and bank 1 contain special function registers. some "high use" special function registers from bank 0 are mirrored in bank 1 for code reduction and quicker access. also note that f0h through ffh on the PIC16C433 is mapped into bank 0 registers 70h-7fh as common ram. 4.2.1 general purpose register file the register file can be accessed either directly or indi- rectly through the file select register fsr (section 4.5). pc<12:0> 13 0000h 0004h 0005h 07ffh 1fffh stack level 1 stack level 8 reset vector on-chip program memory call, return retfie, retlw 0800h 0400h 03ffh peripheral interrupt vector
PIC16C433 ds41139b-page 12 preliminary ? 2002 microchip technology inc. figure 4-2: PIC16C433 register file map 4.2.2 special function registers the special function registers are registers used by the cpu and peripheral modules for controlling the desired operation of the device. these registers are implemented as static ram. the special function registers can be classified into two sets (core and peripheral). those registers associ- ated with the ?core? functions are described in this sec- tion, and those related to the operation of the peripheral features are described in the section of that peripheral feature. indf (1) tmr0 pcl status fsr gpio pclath intcon pir1 adres adcon0 indf (1) option pcl status fsr tris pclath intcon pie1 pcon adcon1 00h 01h 02h 03h 04h 05h 06h 07h 08h 09h 0ah 0bh 0ch 0dh 0eh 0fh 10h 11h 12h 13h 14h 15h 16h 17h 18h 19h 1ah 1bh 1ch 1dh 1eh 1fh 80h 81h 82h 83h 84h 85h 86h 87h 88h 89h 8ah 8bh 8ch 8dh 8eh 8fh 90h 91h 92h 93h 94h 95h 96h 97h 98h 99h 9ah 9bh 9ch 9dh 9eh 9fh 20h a0h general purpose register general purpose register 7fh ffh bank 0 bank 1 file address bfh c0h unimplemented data memory locations, read as '0'. note 1: not a physical register. file address osccal f0h efh mapped in bank 0 70h
? 2002 microchip technology inc. preliminary ds41139b-page 13 PIC16C433 table 4-1: PIC16C433 special function register summary address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on power-on reset value on all other resets (3) bank 0 00h (1) indf addressing this location uses contents of fsr to address data memory (not a physical register) 0000 0000 0000 0000 01h tmr0 timer0 module?s register xxxx xxxx uuuu uuuu 02h (1) pcl program counter's (pc) least significant byte 0000 0000 0000 0000 03h (1) status irp (4) rp1 (4) rp0 to pd zdcc 0001 1xxx 000q quuu 04h (1) fsr indirect data memory address pointer xxxx xxxx uuuu uuuu 05h gpio lintx linrx gp5 gp4 gp3 gp2 gp1 gp0 11xx xxxx 11uu uuuu 06h ? unimplemented ? ? 07h ? unimplemented ? ? 08h ? unimplemented ? ? 09h ? unimplemented ? ? 0ah (1,2) pclath ? ? ? write buffer for the upper 5 bits of the program counter ---0 0000 ---0 0000 0bh (1) intcon gie peie t0ie inte gpie t0if intf gpif 0000 000x 0000 000u 0ch pir1 ?adif ? ? ? ? ? ? -0-- ---- -0-- ---- 0dh ? unimplemented ? ? 0eh ? unimplemented ? ? 0fh ? unimplemented ? ? 10h ? unimplemented ? ? 11h ? unimplemented ? ? 12h ? unimplemented ? ? 13h ? unimplemented ? ? 14h ? unimplemented ? ? 15h ? unimplemented ? ? 16h ? unimplemented ? ? 17h ? unimplemented ? ? 18h ? unimplemented ? ? 19h ? unimplemented ? ? 1ah ? unimplemented ? ? 1bh ? unimplemented ? ? 1ch ? unimplemented ? ? 1dh ? unimplemented ? ? 1eh adres a/d result register xxxx xxxx uuuu uuuu 1fh adcon0 adcs1 adcs0 reserved chs1 chs0 go/done reserved adon 0000 0000 0000 0000 legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented read as '0'. shaded locations are unimplemented, read as ?0?. note 1: these registers can be addressed from either bank. 2: the upper byte of the program counter is not directly accessible. pclath is a holding register for the pc<12:8> whose contents are transferred to the upper byte of the program counter. 3: other (non power-up) resets include external reset through mclr and watchdog timer reset. 4: the irp and rp1 bits are reserved on the PIC16C433; always maintain these bits clear.
PIC16C433 ds41139b-page 14 preliminary ? 2002 microchip technology inc. bank 1 80h (1) indf addressing this location uses contents of fsr to address data memory (not a physical register) 0000 0000 0000 0000 81h option gppu intedg t0cs t0se psa ps2 ps1 ps0 1111 1111 1111 1111 82h (1) pcl program counter's (pc) least significant byte 0000 0000 0000 0000 83h (1) status irp (4) rp1 (4) rp0 to pd zdcc 0001 1xxx 000q quuu 84h (1) fsr indirect data memory address pointer xxxx xxxx uuuu uuuu 85h tris ? ? gpio data direction register --11 1111 --11 1111 86h ? unimplemented ? ? 87h ? unimplemented ? ? 88h ? unimplemented ? ? 89h ? unimplemented ? ? 8ah (1,2) pclath ? ? ? write buffer for the upper 5 bits of the pc ---0 0000 ---0 0000 8bh (1) intcon gie peie t0ie inte gpie t0if intf gpif 0000 000x 0000 000u 8ch pie1 ?adie ? ? ? ? ? ? -0-- ---- -0-- ---- 8dh ? unimplemented ? ? 8eh pcon ? ? ? ? ? ?por ? ---- --0- ---- --u- 8fh osccal cal3 cal2 cal1 cal0 calfst calslw ? ? 0111 00-- uuuu uu-- 90h ? unimplemented ? ? 91h ? unimplemented ? ? 92h ? unimplemented ? ? 93h ? unimplemented ? ? 94h ? unimplemented ? ? 95h ? unimplemented ? ? 96h ? unimplemented ? ? 97h ? unimplemented ? ? 98h ? unimplemented ? ? 99h ? unimplemented ? ? 9ah ? unimplemented ? ? 9bh ? unimplemented ? ? 9ch ? unimplemented ? ? 9dh ? unimplemented ? ? 9eh ? unimplemented ? ? 9fh adcon1 ? ? ? ? ? pcfg2 pcfg1 pcfg0 ---- -000 ---- -000 table 4-1: PIC16C433 special function register summary (continued) address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on power-on reset value on all other resets (3) legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented read as '0'. shaded locations are unimplemented, read as ?0?. note 1: these registers can be addressed from either bank. 2: the upper byte of the program counter is not directly accessible. pclath is a holding register for the pc<12:8> whose contents are transferred to the upper byte of the program counter. 3: other (non power-up) resets include external reset through mclr and watchdog timer reset. 4: the irp and rp1 bits are reserved on the PIC16C433; always maintain these bits clear.
? 2002 microchip technology inc. preliminary ds41139b-page 15 PIC16C433 4.2.2.1 status register the status register, shown in register 4-1, contains the arithmetic status of the alu, the reset status and the bank select bits for data memory. the status register can be the destination for any instruction, as with any other register. if the status reg- ister is the destination for an instruction that affects the z, dc or c bits, then the write to these three bits is disabled. these bits are set or cleared according to the device logic. furthermore, the to and pd bits are not writable. therefore, the result of an instruction with the status register as destination may be different than intended. for example, clrf status will clear the upper three bits and set the z bit. this leaves the status regis- ter as 000u u1uu (where u = unchanged). it is recommended, therefore, that only bcf, bsf, swapf and movwf instructions are used to alter the status register, because these instructions do not affect the z, c or dc bits from the status register. for other instructions, not affecting any status bits, see the "instruction set summary." register 4-1: status register (address 03h, 83h) note 1: bits irp and rp1 (status<7:6>) are not used by the PIC16C433 and should be maintained clear. use of these bits as general purpose r/w bits is not recom- mended, since this may affect upward compatibility with future products. 2: the c and dc bits operate as a borrow and digit borrow bit, respectively, in sub- traction. see the sublw and subwf instructions for examples. reserved reserved r/w-0 r-1 r-1 r/w-x r/w-x r/w-x irp rp1 rp0 to pd zdcc bit7 bit0 bit 7 irp: register bank select bit (used for indirect addressing) 1 = bank 2, 3 (100h - 1ffh) 0 = bank 0, 1 (00h - ffh) the irp bit is reserved, always maintain this bit clear bit 6-5 rp1:rp0 : register bank select bits (used for direct addressing) 11 = bank 3 (180h - 1ffh) 10 = bank 2 (100h - 17fh) 01 = bank 1 (80h - ffh) 00 = bank 0 (00h - 7fh) each bank is 128 bytes. the rp1 bit is reserved, always maintain this bit clear. bit 4 to : timeout bit 1 = after power-up, clrwdt instruction, or sleep instruction 0 = a wdt timeout occurred bit 3 pd : power-down bit 1 = after power-up or by the clrwdt instruction 0 = by execution of the sleep instruction bit 2 z: zero bit 1 = the result of an arithmetic or logic operation is zero 0 = the result of an arithmetic or logic operation is not zero bit 1 dc : digit carry/borrow bit ( addwf , addlw, sublw, subwf instructions) (for borrow the polarity is reversed) 1 = a carry-out from the 4th low order bit of the result occurred 0 = no carry-out from the 4th low order bit of the result bit 0 c: carry/borrow bit ( addwf, addlw, sublw, subwf instructions) 1 = a carry-out from the most significant bit of the result occurred 0 = no carry-out from the most significant bit of the result occurred note: for borrow , the polarity is reversed. a subtraction is executed by adding the two?s complement of the second operand. for rotate ( rrf, rlf ) instructions, this bit is loaded with either the high or low order bit of the source register. legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown
PIC16C433 ds41139b-page 16 preliminary ? 2002 microchip technology inc. 4.2.2.2 option register the option register is a readable and writable regis- ter, which contains various control bits to configure the tmr0/wdt prescaler, the external int interrupt, tmr0 and the weak pull-ups on gpio. register 4-2: option register (address 81h)) note: to achieve a 1:1 prescaler assignment for the tmr0 register, assign the prescaler to the watchdog timer by setting bit psa (option<3>). r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 r/w-1 gppu intedg t0cs t0se psa ps2 ps1 ps0 bit7 bit0 bit 7 gppu : weak pull-up enable bit 1 = weak pull-ups disabled 0 = weak pull-ups enabled (gp0, gp1, gp3) bit 6 intedg : interrupt edge select bit 1 = interrupt on rising edge of gp2/t0cki/an2/int pin 0 = interrupt on falling edge of gp2/t0cki/an2/int pin bit 5 t0cs : tmr0 clock source select bit 1 = transition on gp2/t0cki/an2/int pin 0 = internal instruction cycle clock (clkout) bit 4 t0se : tmr0 source edge select bit 1 = increment on high-to-low transition on gp2/t0cki/an2/int pin 0 = increment on low-to-high transition on gp2/t0cki/an2/int pin bit 3 psa : prescaler assignment bit 1 = prescaler is assigned to the wdt 0 = prescaler is assigned to the timer0 module bit 2-0 ps<2:0> : prescaler rate select bits legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown 000 001 010 011 100 101 110 111 1 : 2 1 : 4 1 : 8 1 : 16 1 : 32 1 : 64 1 : 128 1 : 256 1 : 1 1 : 2 1 : 4 1 : 8 1 : 16 1 : 32 1 : 64 1 : 128 bit value tmr0 rate wdt rate
? 2002 microchip technology inc. preliminary ds41139b-page 17 PIC16C433 4.2.2.3 intcon register the intcon register is a readable and writable regis- ter, which contains various enable and flag bits for the tmr0 register overflow, gpio port change and exter- nal gp2/int pin interrupts. register 4-3: intcon register (address 0bh, 8bh) note: interrupt flag bits get set when an interrupt condition occurs, regardless of the state of its corresponding enable bit or the global enable bit, gie (intcon<7>). r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-x gie peie t0ie inte gpie t0if intf gpif bit7 bit0 bit 7 gie: global interrupt enable bit 1 = enables all unmasked interrupts 0 = disables all interrupts bit 6 peie : peripheral interrupt enable bit 1 = enables all unmasked peripheral interrupts 0 = disables all peripheral interrupts bit 5 t0ie : tmr0 overflow interrupt enable bit 1 = enables the tmr0 interrupt 0 = disables the tmr0 interrupt bit 4 inte : int external interrupt enable bit 1 = enables the external interrupt on gp2/int/t0cki/an2 pin 0 = disables the external interrupt on gp2/int/t0cki/an2 pin bit 3 gpie : gpio interrupt-on-change enable bit 1 = enables the gpio interrupt-on-change 0 = disables the gpio interrupt-on-change bit 2 t0if : tmr0 overflow interrupt flag bit 1 = tmr0 register has overflowed (must be cleared in software) 0 = tmr0 register did not overflow bit 1 intf : rb0/int external interrupt flag bit 1 = the external interrupt on gp2/int/t0cki/an2 pin occurred (must be cleared in software) 0 = the external interrupt on gp2/int/t0cki/an2 pin did not occur bit 0 gpif : gpio interrupt-on-change flag bit 1 = gp0, gp1 or gp3 pins changed state (must be cleared in software) 0 = neither gp0, gp1 nor gp3 pins have changed state legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown
PIC16C433 ds41139b-page 18 preliminary ? 2002 microchip technology inc. 4.2.2.4 pie1 register this register contains the individual enable bits for the peripheral interrupts. register 4-4: pie1 register (address 8ch)) note: bit peie (intcon<6>) must be set to enable any peripheral interrupt. u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 u-0 ?adie ? ? ? ? ? ? bit7 bit0 bit 7 unimplemented: read as '0' bit 6 adie : a/d converter interrupt enable bit 1 = enables the a/d interrupt 0 = disables the a/d interrupt bit 5-0 unimplemented: read as '0' legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown
? 2002 microchip technology inc. preliminary ds41139b-page 19 PIC16C433 4.2.2.5 pir1 register this register contains the individual flag bits for the peripheral interrupts. register 4-5: pir1 register (address 0ch)) note: interrupt flag bits get set when an interrupt condition occurs, regardless of the state of its corresponding enable bit or the global enable bit, gie (intcon<7>). user soft- ware should ensure the appropriate inter- rupt flag bits are clear prior to enabling an interrupt. u-0 r/w-0 u-0 u-0 u-0 u-0 u-0 u-0 ?adif ? ? ? ? ? ? bit7 bit0 bit 7 unimplemented: read as '0' bit 6 adif : a/d converter interrupt flag bit 1 = an a/d conversion completed (must be cleared in software) 0 = the a/d conversion is not complete bit 5-0 unimplemented: read as '0' legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown
PIC16C433 ds41139b-page 20 preliminary ? 2002 microchip technology inc. 4.2.2.6 pcon register the power control (pcon) register contains a flag bit to allow differentiation between a power-on reset (por), an external mclr reset and a wdt reset. register 4-6: pcon register (address 8eh)) u-0 u-0 u-0 u-0 u-0 u-0 r/w-0 u-0 ? ? ? ? ? ?por ? bit7 bit0 bit 7-2 unimplemented: read as '0' bit 1 por : power-on reset status bit 1 = no power-on reset occurred 0 = a power-on reset occurred (must be set in software after a power-on reset occurs) bit 0 unimplemented: read as '0' legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown
? 2002 microchip technology inc. preliminary ds41139b-page 21 PIC16C433 4.2.2.7 osccal register the oscillator calibration (osccal) register is used to calibrate the internal 4 mhz oscillator. it contains four bits for fine calibration and two other bits to either increase or decrease frequency. register 4-7: osccal register (address 8fh) r/w-0 r/w-1 r/w-1 r/w-1 r/w-0 r/w-0 u-0 u-0 cal3 cal2 cal1 cal0 calfst calslw ? ? bit7 bit0 bit 7-4 cal<3:0>: fine calibration bits bit 3 calfst : calibration fast bit 1 = increase frequency 0 = no change bit 2 calslw : calibration slow bit 1 = decrease frequency 0 = no change bit 1-0 unimplemented: read as '0' note: if calfst = 1 and calslw = 1, calfst has precedence. legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown
PIC16C433 ds41139b-page 22 preliminary ? 2002 microchip technology inc. 4.3 pcl and pclath the program counter (pc) is 13-bits wide. the low byte comes from the pcl register, which is a readable and writable register. the high byte (pc<12:8>) is not directly readable or writable and comes from pclath. on any reset, the pc is cleared. figure 4-3 shows the two situations for the loading of the pc. the upper example in figure 4-3 shows how the pc is loaded on a write to pcl (pclath<4:0> pch). the lower example in figure 4-3 shows how the pc is loaded dur- ing a call or goto instruction (pclath<4:3> pch). figure 4-3: loading of pc in different situations 4.3.1 computed goto a computed goto is accomplished by adding an offset to the program counter ( addwf pcl ). when doing a table read using a computed goto method, care should be exercised if the table location crosses a pcl memory boundary (each 256 byte block). refer to the application note ?implementing a table read" (an556). 4.3.2 stack the PIC16C433 family has an 8-level deep x 13-bit wide hardware stack. the stack space is not part of either program or data space and the stack pointer is not readable or writable. the pc is pushed onto the stack when a call instruction is executed, or an inter- rupt causes a branch. the stack is poped in the event of a return, retlw or a retfie instruction execu- tion. pclath is not affected by a push or pop oper- ation. the stack operates as a circular buffer. this means that after the stack has been pushed eight times, the ninth push overwrites the value that was stored from the first push. the tenth push overwrites the second push (and so on). 4.4 program memory paging the PIC16C433 ignores both paging bits pclath<4:3>, which are used to access program memory when more than one page is available. the use of pclath<4:3> as general purpose read/write bits for the PIC16C433 is not recommended, since this may affect upward compatibility with future products. pc 12 8 7 0 5 pclath<4:0> pclath instruction with alu result goto, call opcode <10:0> 8 pc 12 11 10 0 11 pclath<4:3> pch pcl 87 2 pclath pch pcl pcl as destination note 1: there are no status bits to indicate stack overflow or stack underflow conditions. 2: there are no instructions/mnemonics called push or pop. these are actions that occur from the execution of the call, return, retlw, and retfie instructions, or the vectoring to an inter- rupt address.
? 2002 microchip technology inc. preliminary ds41139b-page 23 PIC16C433 4.5 indirect addressing, indf and fsr registers the indf register is not a physical register. address- ing the indf register will cause indirect addressing. any instruction using the indf register actually accesses the register pointed to by the file select reg- ister, fsr. reading the indf register itself, indirectly (fsr = '0') will read 00h. writing to the indf register, indirectly results in a no-operation (although status bits may be affected). an effective 9-bit address is obtained by concatenating the 8-bit fsr register and the irp bit (status<7>), as shown in figure 4-4. however, irp is not used in the PIC16C433. a simple program to clear ram locations 20h-2fh using indirect addressing is shown in example 4-1. example 4-1: indirect addressing figure 4-4: direct/indirect addressing movlw 0x20 ;initialize pointer movwf fsr ;to ram next clrf indf ;clear indf register incf fsr,f ;inc pointer btfss fsr,4 ;all done? goto next ;no clear next continue : ;yes continue for register file map detail see figure 4-2. note 1: the rp1 and irp bits are reserved; always maintain these bits clear. data memory indirect addressing direct addressing bank select location select rp1 rp0 (1) 6 0 from opcode irp (1) fsr register 7 0 bank select location select 00 01 10 11 180h 1ffh 00h 7fh bank 0 bank 1 bank 2 bank 3 not used
PIC16C433 ds41139b-page 24 preliminary ? 2002 microchip technology inc. notes:
? 2002 microchip technology inc. preliminary ds41139b-page 25 PIC16C433 5.0 i/o port as with any other register, the i/o register can be writ- ten and read under program control. however, read instructions (i.e., movf gpio,w ) always read the i/o pins independent of the pin?s input/output modes. on reset, all i/o ports are defined as input (inputs are at hi-impedance), since the i/o control registers are all set. 5.1 gpio gpio is an 8-bit i/o register. only the low order 6 bits are used (gp<5:0>). bits 6 and 7 (lintx and linrx, respectively) are used by the lin bus transceiver peripheral. please note that gp3 is an input only pin. the configuration word can set several i/o?s to alter- nate functions. when acting as alternate functions, the pins will read as ?0? during port read. pins gp0, gp1 and gp3 can be configured with weak pull-ups and also with interrupt-on-change. the interrupt-on-change and weak pull-up functions are not pin selectable. if pin 4 (gp3), is configured as mclr , a weak pull-up is always on. interrupt-on-change for this pin is not set and gp3 will read as '0'. interrupt-on-change is enabled by setting bit gpie, intcon<3>. note that external oscillator use overrides the gpio functions on gp4 and gp5. 5.2 tris register this register controls the data direction for gpio. a '1' from a tris register bit puts the corresponding output driver in a hi-impedance mode. a '0' puts the contents of the output data latch on the selected pins, enabling the output buffer. the exceptions are gp3, which is input only and its tris bit will always read as '1', while gp6 and gp7 tris bits will read as ?0?. upon reset, the tris register is all '1's, making all pins inputs. tris for pins gp4 and gp5 is forced to a ?1?, where appropriate. writes to tris <5:4> will have an effect in extrc and intrc oscillator modes only. when gp4 is configured as clkout, changes to tris<4> will have no effect. 5.3 i/o interfacing the equivalent circuit for an i/o port pin is shown in figure 5-1 through figure 5-5. all port pins, except gp3, which is input only, may be used for both input and output operations. for input operations, these ports are non-latching. any input must be present until read by an input instruction (i.e., movf gpio,w ). the outputs are latched and remain unchanged until the output latch is rewritten. to use a port pin as output, the corresponding direction control bit in tris must be cleared (= 0). for use as an input, the corresponding tris bit must be set. any i/o pin (except gp3) can be programmed individually as input or output. port pins lintx and linrx are used for the lin bus transceiver. these port pins are not available externally on the package. users should avoid writing to pins gp6 (sda) and gp7 (scl), when not communicating with the lin bus transceiver. note: a read of the ports reads the pins, not the output data latches. that is, if an output driver on a pin is enabled and driven high, but the external system is holding it low, a read of the port will indicate that the pin is low. note: on a power-on reset, gp0, gp1, gp2 and gp4 are configured as analog inputs and read as '0'.
PIC16C433 ds41139b-page 26 preliminary ? 2002 microchip technology inc. figure 5-1: block diagram of gp0/an0 and gp1/an1/v ref pin data bus p n wr port wr tris rd tris v dd data latch dq ck q tris latch v dd p v dd d q en rd port to a/d converter analog input mode ttl input buffer i/o pin gppu v ss dq ck q v ss gp0/int (1) and gp1/int (1) note 1: wake-up on pin change interrupts for gp0 and gp1.
? 2002 microchip technology inc. preliminary ds41139b-page 27 PIC16C433 figure 5-2: block diagram of gp2/t0cki/an2/int pin data bus p n wr port wr tris rd tris v dd dq ck q data latch dq ck q tris latch d q en rd port to a/d converter analog input mode schmitt trigger input buffer i/o pin tmr0 clock input gp2/int v ss v dd v ss
PIC16C433 ds41139b-page 28 preliminary ? 2002 microchip technology inc. figure 5-3: block diagram of gp3/mclr /v pp pin p gppu v dd d q en rd port schmitt trigger input buffer input pin v ss mclren rd tris data bus program mode hv detect mclr gp3/int (1) note 1: wake-up on pin change interrupt for gp3. ttl input buffer v ss
? 2002 microchip technology inc. preliminary ds41139b-page 29 PIC16C433 figure 5-4: block diagram of gp4/osc2/an3/clkout pin data bus p n wr port wr tris rd tris v dd dq ck q data latch dq ck q tris latch d q en rd port to a/d converter analog input mode ttl input buffer i/o pin v ss 0 1 from osc1 oscillator circuit intrc or extrc w/o clkout intrc or extrc w/ clkout clkout (f osc /4) v dd v ss intrc/ extrc
PIC16C433 ds41139b-page 30 preliminary ? 2002 microchip technology inc. figure 5-5: block diagram of gp5/osc1/clkin pin table 5-1: summary of port registers data bus p n wr port wr tris rd tris v dd dq en q data latch dq en q tris latch d q en rd port intrc ttl input buffer i/o pin v ss v ss v dd to osc2 oscillator circuit intrc address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on power-on reset value on all other resets 85h tris ? ? gpio data direction register --11 1111 --11 1111 81h option gppu intedg t0cs t0se psa ps2 ps1 ps0 1111 1111 1111 1111 03h status irp (1) rp1 (1) rp0 to pd zdcc 0001 1xxx 000q quuu 05h gpio lintx linrx gp5 gp4 gp3 gp2 gp1 gp0 11xx xxxx 11uu uuuu legend: shaded cells not used by port registers, read as ?0?, ? = unimplemented, read as '0', x = unknown, u = unchanged, q = see tables in section 9.4 for possible values. note 1: the irp and rp1 bits are reserved on the PIC16C433; always maintain these bits clear.
? 2002 microchip technology inc. preliminary ds41139b-page 31 PIC16C433 5.4 i/o programming considerations 5.4.1 bi-directional i/o ports any instruction which writes, operates internally as a read followed by a write operation. the bcf and bsf instructions, for example, read the register into the cpu, execute the bit operation and write the result back to the register. caution must be used when these instructions are applied to a port with both inputs and outputs defined. for example, a bsf operation on bit5 of gpio will cause all eight bits of gpio to be read into the cpu. then, the bsf operation takes place on bit5 and gpio is written to the output latches. if another bit of gpio is used as a bi-directional i/o pin (i.e., bit0) and it is defined as an input at this time, the input signal present on the pin itself would be read into the cpu and rewritten to the data latch of this particular pin, overwrit- ing the previous content. as long as the pin stays in the input mode, no problem occurs. however, if bit0 is switched to an output, the content of the data latch may now be unknown. reading the port register reads the values of the port pins. writing to the port register writes the value to the port latch. when using read-modify-write instructions (i.e., bcf, bsf , etc.) on a port, the value of the port pins is read, the desired operation is done to this value, and this value is then written to the port latch. example 5-1 shows the effect of two sequential read- modify-write instructions on an i/o port. example 5-1: read-modify-write instructions on an i/o port a pin actively outputting a low or high should not be driven from external devices at the same time, in order to change the level on this pin (?wired-or?, ?wired-and?). the resulting high output currents may damage the chip. ;initial gpio settings ; gpio<5:3> inputs ; gpio<2:0> outputs ; ; gpio latch gpio pins ; ---------- ---------- bcf gpio,5 ;pp01 -ppp pp11 pppp bcf gpio,4 ;pp10 -ppp pp11 pppp movlw 007h ; tris gpio ;pp10 -ppp pp10 pppp ; ; note that the user may have expected the pin ;values to be --00 pppp. the 2nd bcf caused gp5 ;to be latched as the pin value (high).
PIC16C433 ds41139b-page 32 preliminary ? 2002 microchip technology inc. notes:
? 2002 microchip technology inc. preliminary ds41139b-page 33 PIC16C433 6.0 lin bus transceiver the PIC16C433 has an integrated lin bus transceiver, which allows the microcontroller to communicate via a lin bus. the lin bus protocol is handled by the micro- controller. the conversion from 5v signal to lin bus signals is handled by the transceiver 6.1 the lin bu s protocol the lin bus protocol is not described within this docu- ment. for further information regarding the lin bus protocol, please refer to www.lin-subbus.org. 6.2 lin bus interfacin g the lin protocol is implemented and programmed by the user, using the lintx and linrx bits, which are used to interface to the transceiver. the lin bus firm- ware transmits by toggling the lintx bit in the gpio register and is read by reading the linrx bit in the gpio register. all aspects of the protocol are handled by software (i.e. bit-banged), where the transceiver is used as the physical interface to the lin bus network. for lin bus slave implementation software, please refer to microchip's web site (www.microchip.com). the transceiver in the PIC16C433 uses the microcon- troller's dual-die interface; therefore, the software must initialize the lintx and linrx bits to a '1' before each lin communication. if the lintx bit is left cleared (e.g., clrf gpio), no other nodes on the network will be able to communicate on the lin bus until lintx is set to '1' for '0' is the dominate state for the protocol. example 6-1: initializing lintx and linrx bits it is recommended that the firmware verify each bit transmitted, by comparing the lintx and linrx bits, to ensure no bus contention or hardware failure has occurred. the lintx and linrx bits have no associ- ated tris bits. therefore, lintx is always an output and linrx is always an input. 6.3 l in bus hardware interface figure 6-3 shows how to implement the hardware lin bus interface in a master configuration and figure 6-4 in a slave configuration using the PIC16C433. figure 6-5 shows how to implement the hardware for a master configuration using bact pin to generate a wake-up interrupt using gp2. the transceiver has an internal series resistor and diode, as defined in the lin 1.2 specification, connecting v bat and lin pin. figure 6-1: block diagram of linrx (sda line) movlw h'c0' movwf gpio en d en qd ck reset ck q data bus write output latch schmitt trigger ltchpin input latch read v dd gpio gpio to lin transceiver
PIC16C433 ds41139b-page 34 preliminary ? 2002 microchip technology inc. figure 6-2: block diagram of lintx 6.4 t hermal shut d own in thermal shutdown, the lin bus output is disabled instantaneously. the output transistor is turned off, regardless of the input level at pin lintx bit and only a limited current can flow into the receiver connected to the lin bus pin. 6.5 wake -u p from sleep upon bus activit y the PIC16C433 can wake-up from sleep upon bus activity in the following way: 1. connect bact to one of gpio<0:3> pins. the bact output is a cmos-levels representation of the lin pin. this signal can be routed to one of the gpio<0:3> pins. the gpio<2> external interrupt or gpio<0:1,3> interrupt-on-change wakes up the device from sleep. any one of the four gpio pins can be used for wake-up where gpio<2> offers multiple con- figuration options (section 9.5.2) and gpio<0:1,3> are interrupt-on-change (section 9.5.3). en d en qd ck ck q data bus write ltchpin read v dd schmitt trigger gpio gpio to lin transceiver note: no resistor or diode is required between v bat pin and 12v supply and for slave con- figuration. note: tlinrx must be set to ?1? at all times. note: bact pin is an output and must be left open if unused.
? 2002 microchip technology inc. preliminary ds41139b-page 35 PIC16C433 figure 6-3: typical lin bus master application figure 6-4: typical lin bus slave application to lin bus note 1 v dd v ss v bat lin +5v PIC16C433 1k ? bact +12v (2) note 1: may not be required. 2: bact pin should be left open if not used. to lin bus note 1 v dd v ss v bat lin +5v bact +12v (2) note 1: may not be required, based on bus capacitance. 2: bact pin should be left open if not used. PIC16C433
PIC16C433 ds41139b-page 36 preliminary ? 2002 microchip technology inc. figure 6-5: lin bus application using wake-up interrupt table 6-1: summary of lin bus transceiver registers address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on: por value on all other resets 05h gpio lintx linrx gp5 gp4 gp3 gp2 gp1 gp0 11xx xxxx 11uu uuuu legend: x = unknown, u = unchanged. shaded cells not used by lin transceiver. to lin bus note 2 v dd v ss v bat lin +5v 1k ? bact gp2 +12v (1) PIC16C433 note 1: for master configuration only. 2: may not be required.
? 2002 microchip technology inc. preliminary ds41139b-page 37 PIC16C433 7.0 timer0 module the timer0 module timer/counter has the following features:  8-bit timer/counter  readable and writable  8-bit software programmable prescaler  internal or external clock select  interrupt on overflow from ffh to 00h  edge select for external clock figure 7-1 is a simplified block diagram of the timer0 module. timer mode is selected by clearing bit t0cs (option<5>). in timer mode, the timer0 module will increment every instruction cycle (without prescaler). if the tmr0 register is written, the increment is inhibited for the following two instruction cycles (figure 7-2 and figure 7-3). the user can work around this by writing an adjusted value to the tmr0 register. counter mode is selected by setting bit t0cs (option<5>). in counter mode, timer0 will increment either on every rising or falling edge of pin ra4/t0cki. the incrementing edge is determined by the bit t0se (option<4>). clearing bit t0se selects the rising edge. restrictions on the external clock input are dis- cussed in detail in section 7.2. the prescaler is mutually exclusively shared between the timer0 module and the watchdog timer. the prescaler assignment is controlled in software by con- trol bit psa (option<3>). clearing bit psa will assign the prescaler to the timer0 module. the prescaler is not readable or writable. when the prescaler is assigned to the timer0 module, pre-scale values of 1:2, 1:4, ..., 1:256 are selectable. section 7.3 details the operation of the prescaler. 7.1 timer0 interrupt the tmr0 interrupt is generated when the tmr0 reg- ister overflows from ffh to 00h. this overflow sets bit t0if (intcon<2>). the interrupt can be masked by clearing bit t0ie (intcon<5>). bit t0if must be cleared in software by the timer0 module interrupt ser- vice routine before re-enabling this interrupt. the tmr0 interrupt cannot awaken the processor from sleep, since the timer is shut-off during sleep. see figure 7-4 for timer0 interrupt timing. figure 7-1: timer0 block diagram figure 7-2: timer0 timing: internal clock/no prescale note 1: tocs, tose, psa, ps<2:0> (option<5:0>). 2: the prescaler is shared with watchdog timer (refer to figure 7-6 for detailed block diagram). gp2/tocki/ tose 0 1 1 0 an2/int tocs f osc /4 programmable prescaler sync with internal clocks tmr0 (2 t cy delay) data bus 8 psa ps<2:0> set interrupt flag bit t0if on overflow 3 pc-1 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 pc (program counter) instruction fetch tmr0 pc pc+1 pc+2 pc+3 pc+4 pc+5 pc+6 t0 t0+1 t0+2 nt0 nt0 nt0 nt0+1 nt0+2 t 0 movwf tmr0 movf tmr0,w movf tmr0,w movf tmr0,w movf tmr0,w movf tmr0,w write tmr0 executed read tmr0 reads nt0 read tmr0 reads nt0 read tmr0 reads nt0 read tmr0 reads nt0 + 1 read tmr0 reads nt0 + 2 instruction executed
PIC16C433 ds41139b-page 38 preliminary ? 2002 microchip technology inc. figure 7-3: timer0 timing: internal clock/prescale 1:2 figure 7-4: timer0 interrupt timing pc-1 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 pc (program counter) instruction fetch tmr0 pc pc+1 pc+2 pc+3 pc+4 pc+5 pc+6 t0 nt0+1 movwf tmr0 movf tmr0,w movf tmr0,w movf tmr0,w movf tmr0,w movf tmr0,w write tmr0 executed read tmr0 reads nt0 read tmr0 reads nt0 read tmr0 reads nt0 read tmr0 reads nt0 read tmr0 reads nt0 + 1 t0+1 nt0 instruction execute q2 q1 q3 q4 q2 q1 q3 q4 q2 q1 q3 q4 q2 q1 q3 q4 q2 q1 q3 q4 1 1 osc1 clkout (3) timer0 t0if bit (intcon<2>) feh gie bit (intcon<7>) instruction pc instruction fetched pc pc +1 pc +1 0004h 0005h instruction executed inst (pc) inst (pc-1) inst (pc+1) inst (pc) inst (0004h) inst (0005h) inst (0004h) dummy cycle dummy cycle ffh 00h 01h 02h flow interrupt latency (2) note 1: interrupt flag bit t0if is sampled here (every q1). 2: interrupt latency = 3t cy where t cy = instruction cycle time. 3: clkout is available only in the intrc and extrc oscillator modes.
? 2002 microchip technology inc. preliminary ds41139b-page 39 PIC16C433 7.2 using timer0 with an external clock when an external clock input is used for timer0, it must meet certain requirements. the requirements ensure the external clock can be synchronized with the internal phase clock (t osc ). also, there is a delay in the actual incrementing of timer0 after synchronization. 7.2.1 external clock synchronization when no prescaler is used, the external clock input is used as the clock source. the synchronization of t0cki with the internal phase clocks is accomplished by sampling the prescaler output on the q2 and q4 cycles of the internal phase clocks (figure 7-5). there- fore, it is necessary for t0cki to be high for at least 2t osc (and a small rc delay of 20 ns) and low for at least 2t osc (and a small rc delay of 20 ns). refer to the electrical specification of the desired device. when a prescaler is used, the external clock input is divided by the asynchronous ripple-counter type pres- caler, so that the prescaler output is symmetrical. for the external clock to meet the sampling requirement, the ripple-counter must be taken into account. there- fore, it is necessary for t0cki to have a period of at least 4t osc (and a small rc delay of 40 ns), divided by the prescaler value. the only requirement on t0cki high and low time is that they do not violate the mini- mum pulse width requirement of 10 ns. refer to param- eters 40, 41 and 42 in the electrical specification of the desired device. 7.2.2 tmr0 increment delay since the prescaler output is synchronized with the internal clocks, there is a small delay from the time the external clock edge occurs to the time the timer0 mod- ule is actually incremented. figure 7-5 shows the delay from the external clock edge to the timer incrementing. figure 7-5: timer0 timing with external clock q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 external clock input or prescaler output (2) external clock/prescaler output after sampling increment timer0 (q4) timer0 t0 t0 + 1 t0 + 2 small pulse misses sampling (3) (1) note 1: delay from clock input change to timer0 increment is 3t osc to 7t osc (duration of q = t osc ). therefore, the error in measuring the interval between two edges on timer0 input = 4t osc max. 2: external clock if no prescaler selected; prescaler output otherwise. 3: the arrows indicate the points in time where sampling occurs.
PIC16C433 ds41139b-page 40 preliminary ? 2002 microchip technology inc. 7.3 pre scaler an 8-bit counter is available as a prescaler for the timer0 module, or as a postscaler for the watchdog timer, respectively (figure 7-6). for simplicity, this counter is being referred to as ?prescaler? throughout this data sheet. note that there is only one prescaler available which is mutually exclusively shared between the timer0 module and the watchdog timer. thus, a prescaler assignment for the timer0 module means that there is no prescaler for the watchdog timer, and vice-versa. the psa and ps<2:0> bits (option<3:0>) determine the prescaler assignment and prescale ratio. when assigned to the timer0 module, all instructions writing to the tmr0 register (i.e., clrf 1, movwf 1, bsf 1,x ...., etc.) will clear the prescaler. when assigned to wdt, a clrwdt instruction will clear the prescaler along with the watchdog timer. the pres- caler is not readable or writable. figure 7-6: block diagram of the timer0/wdt prescaler gp2/t0cki/ t0se an2/int m u x clkout (= f osc /4) sync 2 cycles tmr0 reg 8-bit prescaler 8 - to - 1mux m u x m u x watchdog timer psa 0 1 0 1 wdt timeout ps<2:0> 8 note: t0cs, t0se, psa, ps<2:0> are (option<5:0>). psa wdt enable bit m u x 0 1 0 1 data bus set flag bit t0if on overflow 8 psa t0cs
? 2002 microchip technology inc. preliminary ds41139b-page 41 PIC16C433 7.3.1 switching prescaler assignment the prescaler assignment is fully under software con- trol (i.e., it can be changed ?on-the-fly? during program execution). example 7-1: changing prescaler (timer0 wdt) to change prescaler from the wdt to the timer0 mod- ule, use the sequence shown in example 7-2. example 7-2: changing prescaler (wdt timer0) table 7-1: registers associated with timer0 note: to avoid an unintended device reset, the following instruction sequence (shown in example 7-1) must be executed when changing the prescaler assignment from timer0 to the wdt. this sequence must be followed even if the wdt is disabled. bcf status, rp0 ;bank 0 clrf tmr0 ;clear tmr0 & prescaler bsf status, rp0 ;bank 1 clrwdt ;clears wdt movlw b'xxxx1xxx' ;select new prescale movwf option_reg ;value & wdt bcf status, rp0 ;bank 0 clrwdt ;clear wdt and ;prescaler bsf status, rp0 ;bank 1 movlw b'xxxx0xxx' ;select tmr0, new ;prescale value and movwf option_reg ;clock source bcf status, rp0 ;bank 0 address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on por value on all other resets 01h tmr0 timer0 module?s register xxxx xxxx uuuu uuuu 0bh/8bh intcon gie peie t0ie inte gpie t0if intf gpif 0000 000x 0000 000u 81h option gppu intedg t0cs t0se psa ps2 ps1 ps0 1111 1111 1111 1111 85h tris ? ? tris5 tris4 tris3 tris2 tris1 tris0 --11 1111 --11 1111 legend: x = unknown, u = unchanged, - = unimplemented locations read as '0'. shaded cells are not used by timer0.
PIC16C433 ds41139b-page 42 preliminary ? 2002 microchip technology inc. notes:
? 2002 microchip technology inc. preliminary ds41139b-page 43 PIC16C433 8.0 analog-to-digital converter (a/d) module the analog-to-digital (a/d) converter module has four analog inputs. the a/d allows conversion of an analog input signal to a corresponding 8-bit digital number (refer to applica- tion note an546 for use of a/d converter). the output of the sample and hold is the input into the converter, which generates the result via successive approxima- tion. the analog reference voltage is software select- able to either the device?s positive supply voltage (v dd ), or the voltage level on the gp1/an1/v ref pin. the a/d converter has a unique feature of being able to operate while the device is in sleep mode. the a/d module has three registers. these registers are:  a/d result register (adres)  a/d control register 0 (adcon0)  a/d control register 1 (adcon1) the adcon0 register, shown in figure 8-1, controls the operation of the a/d module. the adcon1 regis- ter, shown in figure 8-2, configures the functions of the port pins. the port pins can be configured as analog inputs (gp1 can also be a voltage reference) or as digital i/o. register 8-1: adcon0 register (address 1fh) note 1: if the port pins are configured as analog inputs (reset condition), reading the port ( movf gpio,w ) results in reading '0's. 2: changing adcon1 register can cause the gpif and intf flags to be set in the intcon register. these interrupts should be disabled prior to modifying adcon1. r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 r/w-0 adcs1 adcs0 reserved chs1 chs0 go/done reserved adon bit7 bit0 bit 7-6 adcs<1:0>: a/d conversion clock select bits 00 = f osc /2 01 = f osc /8 10 = f osc /32 11 = f rc (clock derived from an rc oscillation) bit 5 reserved bit 4-3 chs<1:0>: analog channel select bits 00 = channel 0, (gp0/an0) 01 = channel 1, (gp1/an1) 10 = channel 2, (gp2/an2) 11 = channel 3, (gp4/an3) bit 2 go/done : a/d conversion status bit if adon = 1: 1 = a/d conversion in progress (setting this bit starts the a/d conversion) 0 = a/d conversion not in progress (this bit is automatically cleared by hardware when the a/d conversion is complete) bit 1 reserved bit 0 adon: a/d on bit 1 = a/d converter module is operating 0 = a/d converter module is shut-off and consumes no operating current legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown
PIC16C433 ds41139b-page 44 preliminary ? 2002 microchip technology inc. register 8-2: adcon1 register (address 9fh u-0 u-0 u-0 u-0 u-0 r/w-0 r/w-0 r/w-0 ? ? ? ? ? pcfg2 pcfg1 pcfg0 bit7 bit0 bit 7-2 unimplemented: read as ?0? bit 1-0 pcfg<2:0>: a/d port configuration control bits legend: r = readable bit w = writable bit u = unimplemented bit, read as ?0? - n = value at por ?1? = bit is set ?0? = bit is cleared x = bit is unknown a = analog input d = digital i/o note 1: value on reset. 2: any instruction that reads a pin configured as an analog input will read a '0'. pcfg<2:0> gp4 gp2 gp1 gp0 v ref 000 (1) a aaav dd 001 aav ref agp1 010 d aaav dd 011 dav ref agp1 100 ddaav dd 101 ddv ref agp1 110 dddav dd 111 d dddv dd
? 2002 microchip technology inc. preliminary ds41139b-page 45 PIC16C433 the adres register contains the result of the a/d conversion. when the a/d conversion is complete, the result is loaded into the adres register, the go/done bit (adcon0<2>) is cleared and a/d interrupt flag bit adif (pie1<6>) is set. the block diagrams of the a/d module are shown in figure 8-1. after the a/d module has been configured as desired, the selected channel must be acquired before the con- version is started. the analog input channels must have their corresponding tris bits selected as an input. to determine sample time, see section 8.1. after this acquisition time has elapsed, the a/d conversion can be started. the following steps should be followed for doing an a/d conversion: 1. configure the a/d module:  configure analog pins/voltage reference/ and digital i/o (adcon1 and tris)  select a/d input channel (adcon0)  select a/d conversion clock (adcon0)  turn on a/d module (adcon0) 2. configure a/d interrupt (if desired):  clear adif bit  set adie bit set gie bit 3. wait the required acquisition time. 4. start conversion: set go/done bit (adcon0) 5. wait for a/d conversion to complete, by either:  polling for the go/done bit to be cleared or  waiting for the a/d interrupt 6. read a/d result register (adres), clear bit adif if required. 7. for the next conversion, go to step 1, step 2, or step 3, as required. the a/d conversion time per bit is defined as t ad . a minimum wait of 2t ad is required before next acquisition starts. figure 8-1: a/d block diagram (input voltage) v in v ref (reference voltage) v dd pcfg<2:0> chs<1:0> gp4/an3 gp0/an0 gp2/an2 gp1/an1/v ref 11 10 01 00 a/d converter
PIC16C433 ds41139b-page 46 preliminary ? 2002 microchip technology inc. 8.1 a/d sampling requirements for the a/d converter to meet its specified accuracy, the charge holding capacitor (c hold ) must be allowed to fully charge to the input channel voltage level. the analog input model is shown in figure 8-2. the source impedance (r s ) and the internal sampling switch (r ss ) impedance directly affect the time required to charge the capacitor c hold . the sampling switch (r ss ) impedance varies over the device voltage (v dd ), see figure 8-2. the maximum recommended imped- ance for analog sources is 10 k ? . after the analog input channel is selected (changed), this acquisition must be done before the conversion can be started. to calculate the minimum acquisition time, equation 8-1 may be used. this equation assumes that 1/2 lsb error is used (512 steps for the a/d). the 1/2 lsb error is the maximum error allowed for the a/d to meet its specified resolution. equation 8-1: a/d minimum charging time example 8-1 shows the calculation of the minimum required acquisition time t acq . this calculation is based on the following system assumptions. rs = 10 k ? 1/2 lsb error v dd = 5v rss = 7 k ? temperature (system max.) = 50 c v hold = 0 @ t = 0 example 8-1: calculating the minimum required sample time figure 8-2: analog input model v hold = (v ref - (v ref /512))  (1 - e (-tc/c hold (r ic + r ss + r s )) ) or tc = -(51.2 pf)(1 k ? + r ss + r s ) ln(1/511) note 1: the reference voltage (v ref ) has no effect on the equation, since it cancels itself out. 2: the charge holding capacitor (c hold ) is not discharged after each conversion. 3: the maximum recommended impedance for analog sources is 10 k ? . this is required to meet the pin leakage specifi- cation. 4: after a conversion has completed, a 2.0 t ad delay must complete before acquisition can begin again. during this time, the holding capacitor is not con- nected to the selected a/d input channel. t acq = internal amplifier settling time + holding capacitor charging time + temperature coefficient t acq =5 s + tc + [(temp - 25 c)(0.05 s/ c)] t c =-c hold (r ic + r ss + r s ) ln(1/512) -51.2 pf (1 k ? + 7 k ? + 10 k ? ) ln(0.0020) -51.2 pf (18 k ? ) ln(0.0020) -0.921 s (-6.2146) 5.724 s t acq =5 s + 5.724 s + [(50 c - 25 c)(0.05 s/ c)] 10.724 s + 1.25 s 11.974 s c pin va r s ra x 5 pf v dd v t = 0.6v v t = 0.6v i leakage r ic 1k sampling switch ss r ss c hold = dac capacitance v ss 6v sampling switch 5v 4v 3v 2v 567891011 (k ? ) v dd = 51.2 pf 500 na legend: c pin v t i leakage r ic ss c hold = input capacitance = threshold voltage = leakage current at the pin due to = interconnect resistance = sampling switch = sample/hold capacitance (from dac) various junctions
? 2002 microchip technology inc. preliminary ds41139b-page 47 PIC16C433 8.2 selecting the a/d conversion clock the a/d conversion time per bit is defined as t ad . the a/d conversion requires 9.5 t ad per 8-bit conversion. the source of the a/d conversion clock is software selected. the four possible options for t ad are: 2t osc 8t osc 32t osc  internal adc rc oscillator for correct a/d conversions, the a/d conversion clock (t ad ) must be selected to ensure a minimum t ad time of 1.6 s. if the minimum t ad time of 1.6 s can not be obtained, t ad should be 8 s for preferred operation. table 8-1 shows the resultant t ad times derived from the device operating frequencies and the a/d clock source selected. 8.3 configuring analog port pins the adcon1 and tris registers control the opera- tion of the a/d port pins. the port pins that are desired as analog inputs must have their corresponding tris bits set (input). if the tris bit is cleared (output), the digital output level (v oh or v ol ) will be converted. the a/d operation is independent of the state of the chs<2:0> bits and the tris bits. table 8-1: t ad vs. device operating frequencies note 1: when reading the port register, all pins configured as analog input channel will read as cleared (a low level). pins config- ured as digital inputs, will convert an ana- log input. analog levels on a digitally configured input will not affect the conver- sion accuracy. 2: analog levels on any pin that is defined as a digital input (including the an<3:0> pins) may cause the input buffer to consume cur- rent that is out of the devices specification. ad clock source (t ad ) device frequency operation adcs<1:0> 4 mhz 1.25 mhz 333.33 khz 2t osc 00 500 ns (2) 1.6 s6 s 8t osc 01 2.0 s6.4 s 24 s (3) 32t osc 10 8.0 s 25.6 s (3) 96 s (3) internal adc rc oscillator (5) 11 2 - 6 s (1,4) 2 - 6 s (1,4) 2 - 6 s (1) note 1: the rc source has a typical t ad time of 4 s. 2: these values violate the minimum required t ad time. 3: for faster conversion times, the selection of another clock source is recommended. 4: while in rc mode, with device frequency above 1 mhz, conversion accuracy is out of specification. 5: for extended voltage devices (lc), please refer to section 12.0, electrical specifications.
PIC16C433 ds41139b-page 48 preliminary ? 2002 microchip technology inc. 8.4 a/d conversions example 8-2 shows how to perform an a/d conversion. the gpio pins are configured as analog inputs. the analog reference (v ref ) is the device v dd . the a/d interrupt is enabled and the a/d conversion clock is f rc . the conversion is performed on the gp0 channel. clearing the go/done bit during a conversion will abort the current conversion. the adres register will not be updated with the partially completed a/d con- version sample. that is, the adres register will con- tinue to contain the value of the last completed conversion (or the last value written to the adres reg- ister). after the a/d conversion is aborted, a 2t ad wait is required before the next acquisition is started. after this 2t ad wait, an acquisition is automatically started on the selected channel. example 8-2: doing an a/d conversion note: the go/done bit should not be set in the same instruction that turns on the a/d. bsf status, rp0 ; select page 1 clrf adcon1 ; configure a/d inputs bsf pie1, adie ; enable a/d interrupts bcf status, rp0 ; select page 0 movlw 0xc1 ; rc clock, a/d is on, channel 0 is selected movwf adcon0 ; bcf pir1, adif ; clear a/d interrupt flag bit bsf intcon, peie ; enable peripheral interrupts bsf intcon, gie ; enable all interrupts ; ; ensure that the required sampling time for the selected input channel has elapsed. ; then the conversion may be started. ; bsf adcon0, go ; start a/d conversion : ; the adif bit will be set and the go/done bit : ; is cleared upon completion of the a/d conversion.
? 2002 microchip technology inc. preliminary ds41139b-page 49 PIC16C433 8.5 a /d operation during sleep the a/d module can operate during sleep mode. this requires that the a/d clock source be set to rc (adcs<1:0> = 11 ). when the rc clock source is selected, the a/d module waits one instruction cycle before starting the conversion. this allows the sleep instruction to be executed, which eliminates all digital switching noise from the conversion. when the conver- sion is completed, the go/done bit will be cleared, and the result loaded into the adres register. if the a/ d interrupt is enabled, the device will wake-up from sleep. if the a/d interrupt is not enabled, the a/d mod- ule will then be turned off, although the adon bit will remain set. when the a/d clock source is another clock option (not rc), a sleep instruction will cause the present conver- sion to be aborted and the a/d module to be turned off, though the adon bit will remain set. turning off the a/d places the a/d module in its lowest current consumption state. 8.6 a/d accuracy/error the overall accuracy of the a/d is less than 1 lsb for v dd = 5v 10% and the analog v ref = v dd . this over- all accuracy includes offset error, full scale error and integral error. the a/d converter is monotonic over the full v dd range. the resolution and accuracy may be less when either the analog reference (v dd ) is less than 5.0v, or when the analog reference (v ref ) is less than v dd . the maximum pin leakage current is specified in the device data sheet electrical specification, parameter #d060. in systems where the device frequency is low, use of the a/d rc clock is preferred. at moderate to high fre- quencies, t ad should be derived from the device oscil- lator. t ad must not violate the minimum and should be 8 s for preferred operation. this is because t ad , when derived from t osc , is kept away from on-chip phase clock transitions. this reduces, to a large extent, the effects of digital switching noise. this is not possi- ble with the rc derived clock. the loss of accuracy due to digital switching noise can be significant if many i/o pins are active. in systems where the device will enter sleep mode after the start of the a/d conversion, the rc clock source selection is required. in this mode, the digital noise from the modules in sleep is stopped. this method gives high accuracy. 8.7 effects of a reset a device reset forces all registers to their reset state. this forces the a/d module to be turned off, and any conversion is aborted. the value that is in the adres register is not modified for a reset. the adres register will contain unknown data after a power-on reset. 8.8 connection considerations if the input voltage exceeds the rail values (v ss or v dd ) by greater than 0.2v, then the accuracy of the conver- sion is out of specification. an external rc filter is sometimes added for anti- aliasing of the input signal. the r component should be selected to ensure that the total source impedance is kept under the 10 k ? recommended specification. any external components connected (via hi-impedance) to an analog input pin (capacitor, zener diode, etc.) should have very little leakage current at the pin. 8.9 transfer function the ideal transfer function of the a/d converter is as follows: the first transition occurs when the analog input voltage (v ain ) is 1 lsb (or analog v ref /256) (figure 8- 3). figure 8-3: a/d transfer function note: for the a/d module to operate in sleep, the a/d clock source must be set to rc (adcs<1:0> = 11 ). to perform an a/d conversion in sleep, the go/done bit must be set, followed by the sleep instruction. note: for the PIC16C433, care must be taken when using the gp4 pin in a/d conver- sions due to its proximity to the osc1 pin. digital code output ffh feh 04h 03h 02h 01h 00h 0.5 lsb 1 lsb 2 lsb 3 lsb 4 lsb 255 lsb 256 lsb (full scale) analog input voltage
PIC16C433 ds41139b-page 50 preliminary ? 2002 microchip technology inc. figure 8-4: flow chart of a/d operation table 8-2: summary of a/d registers acquire adon = 0 adon = 0? go = 0? a/d clock go = 0 adif = 0 abort conversion wait 2 t ad wake-up yes no ye s no no yes finish conversion go = 0 adif = 1 device in no ye s finish conversion go = 0 adif = 1 wait 2 t ad stay in sleep selected channel = rc? sleep no yes instruction? start of a/d conversion delayed 1 instruction cycle from power-down a/d yes no wait 2 t ad finish conversion go = 0 adif = 1 sleep? sleep? sleep power-down a/d address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 value on power-on reset value on all other resets 0bh/8bh intcon (1) gie peie t0ie inte gpie t0if intf gpif 0000 000x 0000 000u 0ch pir1 ?adif ? ? ? ? ? ? -0-- ---- -0-- ---- 8ch pie1 ?adie ? ? ? ? ? ? -0-- ---- -0-- ---- 1eh adres a/d result register xxxx xxxx uuuu uuuu 1fh adcon0 adcs1 adcs0 reserved chs1 chs0 go/done reserved adon 0000 0000 0000 0000 9fh adcon1 ? ? ? ? ?pcfg2pcfg1pcfg0 ---- -000 ---- -000 05h gpio lintx linrx gp5 gp4 gp3 gp2 gp1 gp0 11xx xxxx 11uu uuuu 85h tris ? ? tris5 tris4 tris3 tris2 tris1 tris0 --11 1111 --11 1111 legend: x = unknown, u = unchanged, - = unimplemented, read as '0'. shaded cells are not used for a/d conversion. note 1: these registers can be addressed from either bank.
? 2002 microchip technology inc. preliminary ds41139b-page 51 PIC16C433 9.0 special features of the cpu what sets a microcontroller apart from other proces- sors are special circuits to deal with the needs of real- time applications. the PIC16C433 device has a host of such features intended to maximize system reliability, minimize cost through elimination of external compo- nents, provide power saving operating modes and offer code protection. these are:  oscillator selection  reset - power-on reset (por) - power-up timer (pwrt) - oscillator start-up timer (ost)  interrupts  watchdog timer (wdt) sleep  code protection  id locations  in-circuit serial programming the PIC16C433 has a watchdog timer, which can be shut-off only through configuration bits. it runs off its own rc oscillator for added reliability. there are two timers that offer necessary delays on power-up. one is the oscillator start-up timer (ost), intended to keep the chip in reset until the crystal oscillator is stable. the other is the power-up timer (pwrt), which pro- vides a fixed delay of 72 ms (nominal) on power-up only, designed to keep the part in reset while the power supply stabilizes. with these two timers on-chip, most applications need no external reset circuitry. sleep mode is designed to offer a very low current power-down mode. the user can wake-up from sleep through external reset, watchdog timer wake-up, or through an interrupt. several oscillator options are also made available to allow the part to fit the application. the intrc/extrc oscillator option saves system cost, while the lp crystal option saves power. a set of configuration bits is used to select vari- ous options. 9.1 configuration bits the configuration bits can be programmed (read as '0'), or left unprogrammed (read as '1'), to select various device configurations. these bits are mapped in pro- gram memory location 2007h. the user will note that address 2007h is beyond the user program memory space. in fact, it belongs to the special test/configuration memory space (2000h- 3fffh), which can be accessed only during programming. register 9-1: config ? configuration word (address: 2007h) cp cp borv1 borv0 cp cp ? boden mclre pwrte wdte fosc2 fosc1 fosc0 bit13 bit0 bit 13-8, 6-5: cp<1:0>: code protection bit pairs (1) 11 = code protection off 10 = locations 400h through 7feh code protected 01 = locations 200h through 7feh code protected 00 = all memory is code protected bit 7: mclre: master clear reset enable bit 1 = master clear enabled 0 = master clear disabled bit 4: pwrte : power-up timer enable bit 1 = pwrt disabled 0 = pwrt enabled bit 3: wdte: watchdog timer enable bit 1 = wdt enabled 0 = wdt disabled bit 2-0: fosc<2:0>: oscillator selection bits 111 = extrc, clockout on osc2 110 = extrc, osc2 is i/o 101 = intrc, clockout on osc2 100 = intrc, osc2 is i/o 011 = invalid selection 010 = hs oscillator 001 = xt oscillator 000 = lp oscillator note: all of the cp<1:0> pairs have to be given the same value to enable the code protection scheme listed. legend r = readable bit w = writable bit u = unimplemented bit, read as ?0? -n = value at por 1 = bit is set 0 = bit is cleared x = bit is unknown
PIC16C433 ds41139b-page 52 preliminary ? 2002 microchip technology inc. 9.2 o scillator configurations 9.2.1 oscillator types the PIC16C433 can be operated in seven different oscillator modes. the user can program three configu- ration bits (f osc <2:0>) to select one of these seven modes:  lp: low power crystal  hs: high speed crystal/resonator  xt: crystal/resonator  intrc*: internal 4 mhz oscillator  extrc*: external resistor/capacitor *can be configured to support clkout 9.2.2 crystal oscillator/ceramic resonators in xt, hs or lp modes, a crystal or ceramic resonator is connected to the gp5/osc1/clkin and gp4/osc2 pins to establish oscillation (figure 9-1). the PIC16C433 oscillator design requires the use of a par- allel cut crystal. use of a series cut crystal may give a frequency out of the crystal manufacturers specifica- tions. when in xt, hs or lp modes, the device can have an external clock source drive the gp5/osc1/ clkin pin (figure 9-2). figure 9-1: crystal operation or ceramic resonator (xt, hs or lp osc configuration) figure 9-2: external clock input operation (xt, hs or lp osc configuration) table 9-1: capacitor selection for ceramic resonators - PIC16C433 table 9-2: capacitor selection for crystal oscillator - PIC16C433 note 1: see capacitor selection tables for recommended values of c1 and c2. 2: a series resistor (r s ) may be required for at strip cut crystals. 3: rf varies with the oscillator mode selected (approx. value = 10 m ? ). c1 (1) c2 (1) xtal osc2 osc1 rf (3) sleep to internal logic r s (2) clock from ext. system osc1 osc2 open osc type resonator freq cap. range c1 cap. range c2 xt 455 khz 2.0 mhz 4.0 mhz 22-100 pf 15-68 pf 15-68 pf 22-100 pf 15-68 pf 15-68 pf hs 4.0 mhz 8.0 mhz 10.0 mhz 15-68 pf 10-68 pf 10-22 pf 15-68 pf 10-68 pf 10-22 pf these values are for design guidance only. since each resonator has its own characteristics, the user should consult the resonator manufacturer for appropriate values of external components. osc type resonator freq cap. range c1 cap. range c2 lp 32 khz (1) 100 khz 200 khz 15 pf 15-30 pf 15-30 pf 15 pf 30-47 pf 15-82 pf xt 100 khz 200 khz 455 khz 1 mhz 2 mhz 4 mhz 15-30 pf 15-30 pf 15-30 pf 15-30 pf 15-30 pf 15-47 pf 200-300 pf 100-200 pf 15-100 pf 15-30 pf 15-30 pf 15-47 pf hs 4 mhz 8 mhz 10 mhz 15-30 pf 15-30 pf 15-30 pf 15-30 pf 15-30 pf 15-30 pf note 1: for v dd > 4.5v, c1 = c2 30 pf is recommended. these values are for design guidance only. r s may be required in hs mode, as well as xt mode, to avoid overdriving crystals with low drive level specifi- cation. since each crystal has its own characteristics, the user should consult the crystal manufacturer for appropriate values of external components.
? 2002 microchip technology inc. preliminary ds41139b-page 53 PIC16C433 9.2.3 external crystal oscillator circuit either a pre-packaged oscillator, or a simple oscillator circuit with ttl gates, can be used as an external crys- tal oscillator circuit. pre-packaged oscillators provide a wide operating range and better stability. a well designed crystal oscillator will provide good perfor- mance with ttl gates. two types of crystal oscillator circuits can be used; one with parallel resonance, or one with series resonance.PIC16C433 figure 9-3 shows implementation of a parallel resonant oscillator circuit. the circuit is designed to use the fun- damental frequency of the crystal. the 74as04 inverter performs the 180-degree phase shift that a parallel oscillator requires. the 4.7 k ? resistor provides the negative feedback for stability. the 10 k ? potentiome- ters bias the 74as04 in the linear region. this circuit could be used for external oscillator designs. figure 9-3: external parallel resonant crystal oscillator circuit figure 9-4 shows a series resonant oscillator circuit. this circuit is also designed to use the fundamental fre- quency of the crystal. the inverter performs a 180- degree phase shift in a series resonant oscillator cir- cuit. the 330 ? resistors provide the negative feedback to bias the inverters in their linear region. figure 9-4: external series resonant crystal oscillator circuit 9.2.4 external rc oscillator for timing insensitive applications, the rc device option offers additional cost savings. the rc oscillator frequency is a function of the supply voltage, the resis- tor (r ext ) and capacitor (c ext ) values, and the operat- ing temperature. in addition to this, the oscillator frequency will vary from unit to unit, due to normal pro- cess parameter variation. furthermore, the difference in lead frame capacitance between package types will also affect the oscillation frequency, especially for low c ext values. the user also needs to take into account variation due to tolerance of external r and c compo- nents used. figure 9-5 shows how the r/c combination is con- nected to the PIC16C433. for r ext values below 2.2 k ? , the oscillator operation may become unstable or stop completely. for very high r ext values (i.e., 1 m ? ), the oscillator becomes sensitive to noise, humidity and leakage. thus, we recommend keeping r ext between 3 k ? and 100 k ? . although the oscillator will operate with no external capacitor (c ext = 0 pf), we recommend using values above 20 pf for noise and stability reasons. with no or small external capacitance, the oscillation frequency can vary dramatically due to changes in external capacitances, such as pcb trace capacitance or pack- age lead frame capacitance. the variation is greater for larger r (since leakage cur- rent variation will affect rc frequency more for large r) and for smaller c (since variation of input capacitance will affect rc frequency more). figure 9-5: external rc oscillator mode 20 pf +5v 20 pf 10k 4.7k 10k 74as04 xtal 10k 74as04 PIC16C433 clkin to other devices 330 74as04 74as04 PIC16C433 clkin to other devices xtal 330 74as04 0.1 f v dd r ext c ext v ss osc1 internal clock PIC16C433 n osc2/clkout f osc /4
PIC16C433 ds41139b-page 54 preliminary ? 2002 microchip technology inc. 9.2.5 internal 4 mhz rc oscillator the internal rc oscillator provides a fixed 4 mhz (nom- inal) system clock at v dd = 5v and 25c. see section 13.0 for information on variation over voltage and temperature. in addition, a calibration instruction is programmed into the last address of the program memory, which con- tains the calibration value for the internal rc oscillator. this value is programmed as a retlw xx instruction, where xx is the calibration value. in order to retrieve the calibration value, issue a call yy instruction, where yy is the last location in program memory. con- trol will be returned to the user?s program with the cali- bration value loaded into the w register. the program should then perform a movwf osccal instruction to load the value into the internal rc oscillator trim register. osccal, when written to with the calibration value, will ?trim? the internal oscillator to remove process variation from the oscillator frequency. bits <7:4>, cal<3:0> are used for fine calibration, while bit3, calfst, and bit2, calslw, are used for more coarse adjustment. adjusting cal<3:0> from 0000 to 1111 yields a higher clock speed. set calfst = 1 for greater increase in frequency, or set calslw = 1 for greater decrease in frequency. note that bits 1 and 0 of osccal are unim- plemented and should be written as 0, when modifying osccal for compatibility with future devices. 9.2.6 clkout the PIC16C433 can be configured to provide a clock out signal (clkout) on pin 3, when the configuration word address (2007h) is programmed with f osc 2, f osc 1, and f osc 0, equal to 101 for intrc or 111 for extrc. the oscillator frequency, divided by 4, can be used for test purposes or to synchronize other logic. 9.3 reset the PIC16C433 differentiates between various kinds of reset:  power-on reset (por) mclr reset during normal operation mclr reset during sleep  wdt reset (normal operation) some registers are not affected in any reset condi- tion; their status is unknown on por and unchanged in any other reset. most other registers are reset to a ?reset state? on power-on reset (por), mclr reset, wdt reset, and mclr reset during sleep. they are not affected by a wdt wake-up, which is viewed as the resumption of normal operation. the to and pd bits are set or cleared differently in different reset situations, as indicated in table 9-5. these bits are used in software to determine the nature of the reset. see table 9-6 for a full description of reset states of all registers. a simplified block diagram of the on-chip reset circuit is shown in figure 9-6. the PIC16C433 has a mclr noise filter in the mclr reset path. the filter will detect and ignore small pulses. it should be noted that a wdt reset does not drive mclr pin low. when mclr is asserted, the state of the osc1/clkin and clkout/osc2 pins are as follows: note: please note that erasing the device will also erase the pre-programmed internal calibration value for the internal oscillator. the calibration value must be saved prior to erasing the part. table 9-3: clkin/clkout pin states when mclr asserted oscillator mode osc1/clkin pin osc2/clkout pin extrc, clkout on osc2 osc1 pin is tri-stated and driven by external circuit osc2 pin is driven low extrc, osc2 is i/o osc1 pin is tri-stated and driven by external circuit osc2 pin is tri-state input intrc, clkout on osc2 osc1 pin is tri-state input osc2 pin is driven low intrc, osc2 is i/o osc1 pin is tri-state input osc2 pin is tri-state input
? 2002 microchip technology inc. preliminary ds41139b-page 55 PIC16C433 figure 9-6: simplified block diagram of on-chip reset circuit s r q weak pull-up gp3/mclr /v pp v dd osc1/ wdt module v dd rise detect ost/pwrt on-chip (1) rc osc wdt timeout power-on reset ost pwrt chip_reset 10-bit ripple-counter enable ost enable pwrt sleep see table 9-4 for timeout situations. note 1: this is a separate oscillator from the rc oscillator of the clkin pin. clkin pin 10-bit ripple-counter mclre internal mclr pin
PIC16C433 ds41139b-page 56 preliminary ? 2002 microchip technology inc. 9.4 power-on reset (por), power-up timer (pwrt) and oscillator start-up timer (ost) 9.4.1 power-on reset (por) the on-chip por circuit holds the chip in reset until v dd has reached a high enough level for proper oper- ation. to take advantage of the por, just tie the mclr pin through a resistor to v dd . this will eliminate exter- nal rc components usually needed to create a power- on reset. a maximum rise time for v dd is specified. see electrical specifications for details. when the device starts normal operation (exits the reset condition), device operating parameters (volt- age, frequency, temperature, ...) must be met to ensure operation. if these conditions are not met, the device must be held in reset until the operating conditions are met. for additional information, refer to application note an607, " power-up trouble shooting ." 9.4.2 power-up timer (pwrt) the power-up timer provides a fixed 72 ms nominal timeout on power-up only, from the por. the power- up timer operates on an internal rc oscillator. the chip is kept in reset as long as the pwrt is active. the pwrt?s time delay allows v dd to rise to an accept- able level. a configuration bit is provided to enable/dis- able the pwrt. the power-up time delay will vary from chip to chip due to v dd , temperature and process variation. 9.4.3 oscillator start-up timer (ost) the oscillator start-up timer (ost) provides 1024 oscillator cycle (from osc1 input) delay after the pwrt delay is over. this ensures that the crystal oscil- lator, or resonator has started and stabilized. the ost timeout is invoked only for xt, lp and hs modes and only on power-on reset or wake-up from sleep. 9.4.4 timeout sequence on power-up, the timeout sequence is as follows: first, pwrt timeout is invoked after the por time delay has expired; then, ost is activated. the total timeout will vary, based on oscillator configuration and the status of the pwrt. for example, in rc mode with the pwrt disabled, there will be no timeout at all. figure 9-7, figure 9-8, and figure 9-9 depict timeout sequences on power-up. since the timeouts occur from the por pulse, if mclr is kept low long enough, the timeouts will expire. then bringing mclr high will begin execution immediately (figure 9-9). this is useful for testing purposes, or to synchronize more than one PIC16C433 device operat- ing in parallel. 9.4.5 power control/status register (pcon) the power control/status register, pcon (address 8eh), has one bit. bit1 is por (power-on reset). it is cleared on a power- on reset and is unaffected otherwise. the user sets this bit following a power-on reset. on subsequent resets, if por is ?0?, it will indicate that a power-on reset must have occurred. table 9-4: timeout in various situations table 9-5: status/pcon bits and their significance legend: u = unchanged, x = unknown oscillator configuration power-up wake-up from sleep pwrte = 0 pwrte = 1 xt, hs, lp 72 ms + 1024t osc 1024t osc 1024t osc intrc, extrc 72 ms ? ? por to pd 011 power-on reset 00x illegal, to is set on por 0x0 illegal, pd is set on por 10u wdt reset 100 wdt wake-up 1uu mclr reset during normal operation 110 mclr reset during sleep or interrupt wake-up from sleep
? 2002 microchip technology inc. preliminary ds41139b-page 57 PIC16C433 table 9-6: reset condition for special registers table 9-7: initialization conditions for all registers condition program counter status register pcon register power-on reset 000h 0001 1xxx ---- --0- mclr reset during normal operation 000h 000u uuuu ---- --u- mclr reset during sleep 000h 0001 0uuu ---- --u- wdt reset during normal operation 000h 0000 uuuu ---- --u- wdt wake-up from sleep pc + 1 uuu0 0uuu ---- --u- interrupt wake-up from sleep pc + 1 (1) uuu1 0uuu ---- --u- legend: u = unchanged, x = unknown, - = unimplemented bit, read as '0' note 1: when the wake-up is due to an interrupt and the gie bit is set, the pc is loaded with the interrupt vector (0004h). register power-on reset mclr reset wdt reset wake-up via wdt or interrupt w xxxx xxxx uuuu uuuu uuuu uuuu indf 0000 0000 0000 0000 0000 0000 tmr0 xxxx xxxx uuuu uuuu uuuu uuuu pcl 0000 0000 0000 0000 pc + 1 (2) status 0001 1xxx 000q quuu (3) uuuq quuu (3) fsr xxxx xxxx uuuu uuuu uuuu uuuu gpio 11xx xxxx 11uu uuuu 11uu uuuu pclath ---0 0000 ---0 0000 ---u uuuu intcon 0000 000x 0000 000u uuuu uqqq (1) pir1 -0-- ---- -0-- ---- -q-- ---- (4) adcon0 0000 0000 0000 0000 uuuu uquu (5) option 1111 1111 1111 1111 uuuu uuuu tris --11 1111 --11 1111 --uu uuuu pie1 -0-- ---- -0-- ---- -u-- ---- pcon ---- --0- ---- --u- ---- --u- osccal 0111 00-- uuuu uu-- uuuu uu-- adcon1 ---- -000 ---- -000 ---- -uuu legend: u = unchanged, x = unknown, - = unimplemented bit, read as '0', q = value depends on condition note 1: one or more bits in intcon and pir1 will be affected (to cause wake-up). 2: when the wake-up is due to an interrupt and the gie bit is set, the pc is loaded with the interrupt vector (0004h). 3: see table 9-5 for reset value for specific condition. 4: if wake-up was due to a/d completing then bit 6 = 1 , all other interrupts generating a wake-up will cause bit 6 = u . 5: if wake-up was due to a/d completing then bit 3 = 0 , all other interrupts generating a wake-up will cause bit 3 = u .
PIC16C433 ds41139b-page 58 preliminary ? 2002 microchip technology inc. figure 9-7: timeout sequence on power-up (mclr not tied to v dd ): case 1 figure 9-8: timeout sequence on power-up (mclr not tied to v dd ): case 2 figure 9-9: timeout sequence on power-up (mclr tied to v dd ) t pwrt t ost v dd mclr internal por pwrt time o ut ost time o ut internal reset v dd mclr internal por pwrt timeout ost timeout internal reset t pwrt t ost t pwrt t ost v dd mclr internal por pwrt timeout ost timeout internal reset
? 2002 microchip technology inc. preliminary ds41139b-page 59 PIC16C433 figure 9-10: external power-on reset circuit (for slow v dd power-up) figure 9-11: external brown-out protection circuit 3 figure 9-12: external brown-out protection circuit 1 figure 9-13: external brown-out protection circuit 2 note 1: external power-on reset circuit is required only if v dd power-up slope is too slow. the diode d helps discharge the capacitor quickly when v dd powers down. 2: r < 40 k ? is recommended to make sure that voltage drop across r does not violate the device?s electrical specification. 3: r1 = 100 ? to 1 k ? will limit any current flowing into mclr from external capacitor c, in the event of mclr /v pp pin breakdown due to electrostatic discharge (esd), or electrical overstress (eos). c r1 r d v dd mclr PIC16C433 this brown-out protection circuit employs microchip technology?s mcp809 microcontroller supervisor. the mcp8xx and mcp1xx families of supervisors provide push-pull and open collector outputs, with both high and low active reset pins. there are 7 different trip point selections to accommodate 5v and 3v systems. mclr PIC16C433 v dd v ss rst mcp809 v dd v dd bypass capacitor note 1: this circuit will activate reset when v dd goes below (vz + 0.7v), where vz = zener voltage. 2: resistors should be adjusted for the character- istics of the transistor. v dd 33k 10k 4.3k v dd mclr PIC16C433 note 1: this brown-out circuit is less expensive, albeit less accurate. transistor q1 turns off when v dd is below a certain level, such that: 2: resistors should be adjusted for the charac- teristics of the transistor. v dd  r1 r1 + r2 = 0.7v v dd r2 4.3k PIC16C433 r1 q1 v dd mclr
PIC16C433 ds41139b-page 60 preliminary ? 2002 microchip technology inc. 9.5 interrupts there are four sources of interrupt: the interrupt control register (intcon) records indi- vidual interrupt requests in flag bits. it also has individ- ual and global interrupt enable bits. a global interrupt enable bit, gie (intcon<7>), enables (if set) all unmasked interrupts, or disables (if cleared) all interrupts. when bit gie is enabled and an interrupt?s flag bit and mask bit are set, the interrupt will vector immediately. individual interrupts can be dis- abled through their corresponding enable bits in vari- ous registers. individual interrupt flag bits are set, regardless of the status of their corresponding mask bit or the gie bit. the gie bit is cleared on reset. the ?return-from-interrupt? instruction, retfie , exits the interrupt routine, as well as sets the gie bit, which re-enables interrupts. the gp2/int, gpio port change interrupt and the tmr0 overflow interrupt flags are contained in the intcon register. the peripheral interrupt flag adif, is contained in the special function register pir1. the corresponding interrupt enable bit is contained in special function register pie1, and the peripheral interrupt enable bit is contained in special function register intcon. when an interrupt is responded to, the gie bit is cleared to disable any further interrupt, the return address is pushed onto the stack and the pc is loaded with 0004h. once in the interrupt service routine, the source(s) of the interrupt can be determined by polling the interrupt flag bits. the interrupt flag bit(s) must be cleared in software before re-enabling interrupts to avoid repeated interrupts. for external interrupt events, such as gpio change interrupt, the interrupt latency will be three or four instruction cycles. the exact latency depends on when the interrupt event occurs (figure 9-15). the latency is the same for one or two cycle instructions. individual interrupt flag bits are set, regardless of the status of their corresponding mask bit or the gie bit. figure 9-14: interrupt logic interrupt sources tmr0 overflow interrupt external interrupt gp2/int pin gpio port change interrupts (pins gp0, gp1, gp3) a/d interrupt note: individual interrupt flag bits are set, regard- less of the status of their corresponding mask bit, or the gie bit. gpif gpie t0if t0ie gie wake-up (if in sleep mode) interrupt to cpu peie adif adie intf inte
? 2002 microchip technology inc. preliminary ds41139b-page 61 PIC16C433 figure 9-15: int pin interrupt timing q2 q1 q3 q4 q2 q1 q3 q4 q2 q1 q3 q4 q2 q1 q3 q4 q2 q1 q3 q4 osc1 clkout int pin intf flag (intcon<1>) gie bit (intcon<7>) instruction flow pc instruction fetched instruction executed interrupt latency pc pc+1 pc+1 0004h 0005h inst (0004h) inst (0005h) dummy cycle inst (pc) inst (pc+1) inst (pc-1) inst (0004h) dummy cycle inst (pc) ? 1 4 5 1 note 1: intf flag is sampled here (every q1). 2: interrupt latency = 3-4 t cy where t cy = instruction cycle time. latency is the same whether inst (pc) is a single cycle, or a 2-cycle instruction. 3: clkout is available only in intrc and extrc oscillator modes. 4: for minimum width of int pulse, refer to ac specs. 5: intf is enabled to be set any time during the q4-q1 cycles. 2 3
PIC16C433 ds41139b-page 62 preliminary ? 2002 microchip technology inc. 9.5.1 tmr0 interrupt an overflow (ffh 00h) in the tmr0 register will set flag bit t0if (intcon<2>). the interrupt can be enabled/disabled by setting/clearing enable bit t0ie (intcon<5>) (see section 7.0). the flag bit t0if (intcon<2>) will be set, regardless of the state of the enable bits. if used, this flag must be cleared in software. 9.5.2 int interrupt external interrupt on gp2/int pin is edge triggered; either rising if bit intedg (option<6>) is set, or fall- ing, if the intedg bit is clear. when a valid edge appears on the gp2/int pin, flag bit intf (intcon<1>) is set. this interrupt can be disabled by clearing enable bit inte (intcon<4>). flag bit intf must be cleared in software in the interrupt service routine before re-enabling this interrupt. the int inter- rupt can wake-up the processor from sleep, if bit inte was set prior to going into sleep. the status of global interrupt enable bit gie decides whether or not the pro- cessor branches to the interrupt vector following wake- up. see section 9.8 for details on sleep mode. 9.5.3 gpio intcon change an input change on gp3, gp1 or gp0 sets flag bit gpif (intcon<0>). the interrupt can be enabled/disabled by setting/clearing enable bit gpie (intcon<3>) (section 5.1). this flag bit gpif (intcon<0>) will be set, regardless of the state of the enable bits. if used, this flag must be cleared in software. 9.6 context saving during interrupts during an interrupt, only the return pc value is saved on the stack. typically, users may wish to save key reg- isters during an interrupt (i.e., w register and status register). this will have to be implemented in software. example 9-1 shows the storing and restoring of the status and w registers. the register, w_temp, must be defined in both banks and must be defined at the same offset from the bank base address (i.e., if w_temp is defined at 0x20 in bank 0, it must also be defined at 0xa0 in bank 1). example 9.7 shows the saving and restoring of status and w using ram locations 0x70 - 0x7f. w_temp is defined at 0x70 and status_temp is defined at 0x71. the example: a) stores the w register. b) stores the status register in bank 0. c) executes the isr code. d) restores the status register (and bank select bit). e) restores the w register. f) returns from interrupt. example 9-1: saving status and w registers using general purpose ram (0x20 - 0x6f) movwf w_temp ;copy w to temp register, could be bank one or zero swapf status,w ;swap status to be saved into w bcf status,rp0 ;change to bank zero, regardless of current bank movwf status_temp ;save status to bank zero status_temp register : :(isr) : swapf status_temp,w ;swap status_temp register into w ;(sets bank to original state) movwf status ;move w into status register swapf w_temp,f ;swap w_temp swapf w_temp,w ;swap w_temp into w retfie ;return from interrupt
? 2002 microchip technology inc. preliminary ds41139b-page 63 PIC16C433 example 9-2: saving status and w registers using shared ram (0x70 - 0x7f) 9.7 watchdog timer (wdt) the watchdog timer is a free running, on-chip rc oscil- lator which does not require any external components. this rc oscillator is separate from the rc oscillator of the osc1/clkin pin. that means that the wdt will run, even if the clock on the osc1/clkin and osc2/clk- out pins of the device has been stopped, for example, by execution of a sleep instruction. during normal oper- ation, a wdt timeout generates a device reset (watchdog timer reset). if the device is in sleep mode, a wdt timeout causes the device to wake-up and continue with normal operation (watchdog timer wake- up). the wdt can be permanently disabled by clearing configuration bit wdte (section 9.1). 9.7.1 wdt period the wdt has a nominal timeout period of 18 ms (with no prescaler). the timeout periods vary with tempera- ture, v dd and process variations from part to part (see dc specs). if longer timeout periods are desired, a prescaler with a division ratio of up to 1:128 can be assigned to the wdt under software control, by writing to the option register. thus, timeout periods up to 2.3 seconds can be realized. the clrwdt and sleep instructions clear the wdt and the postscaler, if assigned to the wdt, and prevent it from timing out early and generating a premature device reset condition. the to bit in the status register will be cleared upon a watchdog timer timeout. 9.7.2 wdt programming considerations it should also be taken into account that under worst case conditions (v dd = min., temperature = max., and max. wdt prescaler), it may take several seconds before a wdt timeout occurs. see example 7-1 and example 7-2 for changing pres- caler between wdt and timer0. movwf w_temp ; copy w to temp register (bank independent) movf status,w ; move status register into w movwf status_temp ; save contents of status register : :(isr) : movf status_temp,w ; retrieve copy of status register movwf status ; restore pre-isr status register contents swapf w_temp,f ; swapf w_temp,w ; restore pre-isr w register contents retfie ;return from interrupt note: when the prescaler is assigned to the wdt, always execute a clrwdt instruc- tion before changing the prescale value, otherwise a wdt reset may occur.
PIC16C433 ds41139b-page 64 preliminary ? 2002 microchip technology inc. figure 9-16: watchdog timer block diagram table 9-8: summary of watchdog timer registers 9.8 power-down mode (sleep) power-down mode is entered by executing a sleep instruction. if enabled, the watchdog timer will be cleared but keeps running, the pd bit (status<3>) is cleared, the to (status<4>) bit is set, and the oscillator driver is turned off. the i/o ports maintain the status they had before the sleep instruction was executed (driving high, low or hi-impedance). for lowest current consumption in this mode, place all i/o pins at either v dd or v ss , ensure no external cir- cuitry is drawing current from the i/o pin, power-down the a/d, and disable external clocks. pull all i/o pins that are hi-impedance inputs, high or low externally, to avoid switching currents caused by floating inputs. the t0cki input, if enabled, should also be at v dd or v ss , for lowest current consumption. the contribution from on-chip pull-ups on gpio should be considered. the mclr pin, if enabled, must be at a logic high level (v ihmc ). 9.8.1 wake-up from sleep the device can wake-up from sleep through one of the following events: 1. external reset input on mclr pin. 2. watchdog timer wake-up (if wdt was enabled). 3. gp2/int interrupt, interrupt gpio port change or some peripheral interrupts. 4. lin bus activity (connect bact to gp2/t0cki/ an2/int pin). external mclr reset will cause a device reset. all other events are considered a continuation of program execution and cause a wake-up . the to and pd bits in the status register can be used to determine the cause of device reset. the pd bit, which is set on power-up, is cleared when sleep is invoked. the to bit is cleared if a wdt timeout occurred (and caused wake-up). the following peripheral interrupt can wake the device from sleep: 1. a/d conversion (when a/d clock source is rc). other peripherals cannot generate interrupts since dur- ing sleep, no on-chip q clocks are present. when the sleep instruction is being executed, the next instruction (pc + 1) is pre-fetched. for the device to wake-up through an interrupt event, the corresponding interrupt enable bit must be set (enabled). wake-up is from tmr0 clock source (figure 7-5) to tmr0 (figure 7-5) postscaler wdt timer wdt enable bit 0 1 m u x psa 8 - to - 1 mux ps<2:0> 0 1 mux psa wdt timeout note: psa and ps<2:0> are bits in the option register. 8 address name bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 2007h config. bits (1) mclre cp1 cp0 pwrte wdte fosc2 fosc1 fosc0 81h option gppu intedg t0cs t0se psa ps2 ps1 ps0 legend: shaded cells are not used by the watchdog timer. note 1: see register 9-1 for operation of these bits. not all cp0 and cp1 bits are shown.
? 2002 microchip technology inc. preliminary ds41139b-page 65 PIC16C433 regardless of the state of the gie bit. if the gie bit is clear (disabled), the device continues execution at the instruction after the sleep instruction. if the gie bit is set (enabled), the device executes the instruction after the sleep instruction and then branches to the inter- rupt address (0004h). in cases where the execution of the instruction following sleep is not desirable, the user should have a nop after the sleep instruction. 9.8.2 wake-up using interrupts when global interrupts are disabled (gie cleared) and any interrupt source has both its interrupt enable bit and interrupt flag bit set, one of the following will occur:  if the interrupt occurs before the execution of a sleep instruction, the sleep instruction will com- plete as a nop . therefore, the wdt and wdt postscaler will not be cleared, the to bit will not be set and pd bits will not be cleared.  if the interrupt occurs during or after the execu- tion of a sleep instruction, the device will imme- diately wake-up from sleep. the sleep instruction will be completely executed before the wake-up. therefore, the wdt and wdt postscaler will be cleared, the to bit will be set and the pd bit will be cleared. even if the flag bits were checked before executing a sleep instruction, it may be possible for flag bits to become set before the sleep instruction completes. to determine whether a sleep instruction executed, test the pd bit. if the pd bit is set, the sleep instruction was executed as a nop . to ensure that the wdt is cleared, a clrwdt instruc- tion should be executed before a sleep instruction. 9.8.3 wake-up from sleep upon bus activity the can be woken up upon bus activity on the lin bus. this is done by connecting the bact pin with either gp0, gp1 or gp2. the pin which will be connected to the bact pin has to be configured to wake the micro- controller up from sleep. figure 9-17: wake-up from sleep through interrupt q1 q2 q3 q4 q1 q2 q3 q4 q1 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 q1 q2 q3 q4 osc1 clkout (4) gpio pin gpif flag (intcon<0>) gie bit (intcon<7>) instruction flow pc instruction fetched instruction executed pc pc+1 pc+2 inst(pc)=sleep inst(pc - 1) inst(pc + 1) sleep processor in sleep interrupt latency (note 3) inst(pc + 2) inst(pc + 1) inst(0004h) inst(0005h) inst(0004h) dummy cycle pc + 2 0004h 0005h dummy cycle t ost (2) pc+2 note 1: xt, hs or lp oscillator mode assumed. 2: t ost = 1024t osc (drawing not to scale). this delay will not be there for intrc and extrc osc mode. 3: gie = '1' assumed. in this case, after wakeup, the processor jumps to the interrupt routine. if gie = '0', execution will conti nue in-line. 4: clkout is not available in xt, hs or lp osc modes, but shown here for timing reference.
PIC16C433 ds41139b-page 66 preliminary ? 2002 microchip technology inc. 9.9 program verification/code protection if the code protection bit(s) have not been pro- grammed, the on-chip program memory can be read out for verification purposes. 9.10 id locations four memory locations (2000h - 2003h) are designated as id locations, where the user can store checksum or other code identification numbers. these locations are not accessible during normal execution, but are read- able and writable during program/verify. it is recom- mended that only the 4 least significant bits of the id location are used. 9.11 in-circuit serial programming PIC16C433 microcontrollers can be serially pro- grammed, while in the end application circuit. this is simply done with two lines for clock and data, and three other lines for power, ground and the programming voltage. this allows customers to manufacture boards with unprogrammed devices, and then program the microcontroller just before shipping the product. this also allows the most recent firmware or a custom firm- ware to be programmed. the device is placed into a program/verify mode by hold- ing the gp1 and gp0 pins low, while raising the mclr (v pp ) pin from v il to v ihh (see programming specifica- tion). gp1 (clock) becomes the programming clock and gp0 (data) becomes the programming data. both gp0 and gp1 are schmitt trigger inputs in this mode. after reset, and if the device is placed into program- ming/verify mode, the program counter (pc) is at loca- tion 00h. a 6-bit command is then supplied to the device. depending on the command, 14 bits of pro- gram data are then supplied to or from the device, depending if the command was a load or a read. for complete details of serial programming, please refer to the PIC16C433 programming specifications. figure 9-18: typical in-circuit serial programming connection note: microchip does not recommend code pro- tecting windowed devices. external connector signals to normal connections to normal connections v dd v ss mclr /v pp gp1 gp0 +5v 0v v pp clk data i/o v dd PIC16C433
? 2002 microchip technology inc. preliminary ds41139b-page 67 PIC16C433 10.0 instruction set summary each PIC16C433 instruction is a 14-bit word divided into an opcode which specifies the instruction type and one or more operands which further specify the operation of the instruction. the PIC16C433 instruction set summary in table 10-2 lists byte-oriented , bit-ori- ented , and literal and control operations. table 10-1 shows the opcode field descriptions. for byte-oriented instructions, 'f' represents a file reg- ister designator and 'd' represents a destination desig- nator. the file register designator specifies which file register is to be used by the instruction. the destination designator specifies where the result of the operation is to be placed. if 'd' is zero, the result is placed in the w register. if 'd' is one, the result is placed in the file register specified in the instruction. for bit-oriented instructions, 'b' represents a bit field designator which selects the number of the bit affected by the operation, while 'f' represents the address of the file in which the bit is located. for literal and control operations, 'k' represents an eight or eleven bit constant or literal value. table 10-1: opcode field descriptions the instruction set is highly orthogonal and is grouped into three basic categories:  byte-oriented operations  bit-oriented operations  literal and control operations all instructions are executed within one single instruc- tion cycle, unless a conditional test is true or the pro- gram counter is changed as a result of an instruction. in this case, the execution takes two instruction cycles with the second cycle executed as a nop . one instruc- tion cycle consists of four oscillator periods. thus, for an oscillator frequency of 4 mhz, the normal instruction execution time is 1 s. if a conditional test is true or the program counter is changed as a result of an instruc- tion, the instruction execution time is 2 s. table 10-2 lists the instructions recognized by the mpasm? assembler. figure 10-1 shows the three general formats that the instructions can have. all examples use the following format to represent a hexadecimal number: 0xhh where h signifies a hexadecimal digit. figure 10-1: general format for instructions field description f register file address (0x00 to 0x7f) w working register (accumulator) b bit address within an 8-bit file register k literal field, constant data or label x don't care location (= 0 or 1) the assembler will generate code with x = 0. it is the recommended form of use for compatibility with all microchip software tools. d destination select; d = 0: store result in w, d = 1: store result in file register f. default is d = 1. label label name tos to p - o f - sta c k pc program counter pclath program counter high latch gie global interrupt enable bit wdt watchdog timer/counter to timeout bit pd power-down bit dest destination either the w register or the specified register file location [ ] options ( ) contents assigned to < > register bit field in the set of i talics user defined term (font is courier) note: to maintain upward compatibility with future PIC16C433 products, do not use the option and tris instructions. byte-oriented file register operations 13 8 7 6 0 d = 0 for destination w opcode d f (file #) d = 1 for destination f f = 7-bit file register address bit-oriented file register operations 13 10 9 7 6 0 opcode b (bit #) f (file #) b = 3-bit bit address f = 7-bit file register address literal and control operations 13 8 7 0 opcode k (literal) k = 8-bit immediate value 13 11 10 0 opcode k (literal) k = 11-bit immediate value general call and goto instructions only
PIC16C433 ds41139b-page 68 preliminary ? 2002 microchip technology inc. 10.1 special function registers as source/destination the PIC16C433?s orthogonal instruction set allows read and write of all file registers, including special function registers. there are some special situations specified in the following sections the user should be aware of. 10.1.1 status as destination if an instruction writes to status, the z, c and dc bits may be set or cleared as a result of the instruction and overwrite the original data bits written. for example, executing clrf status will clear register status, and then set the z bit leaving 0000 0100b in the register. 10.1.2 tris as destination bit 3 of the tris register always reads as a '1' since gp3 is an input only pin. this fact can affect some read-modify-write operations on the tris register. 10.1.3 pcl as source or destination read, write or read-modify-write on pcl may have the following results: read pc: pcl dest write pcl: pclath pch; 8-bit destination value pcl read-modify-write: pcl alu operand pclath pch; 8-bit result pcl where pch = program counter high byte (not an addressable register), pclath = program counter high holding latch, dest = destination, wreg or f. 10.1.4 bit manipulation all bit manipulation instructions are done by first read- ing the entire register, operating on the selected bit and writing the result back (read-modify-write). the user should keep this in mind when operating on special function registers, such as ports.
? 2002 microchip technology inc. preliminary ds41139b-page 69 PIC16C433 table 10-2: instruction set summary mnemonic, operands description cycles 14-bit opcode status affected notes msb lsb byte-oriented file register operations addwf andwf clrf clrw comf decf decfsz incf incfsz iorwf movf movwf nop rlf rrf subwf swapf xorwf f, d f, d f - f, d f, d f, d f, d f, d f, d f, d f - f, d f, d f, d f, d f, d add w and f and w with f clear f clear w complement f decrement f decrement f, skip if 0 increment f increment f, skip if 0 inclusive or w with f move f move w to f no operation rotate left f through carry rotate right f through carry subtract w from f swap nibbles in f exclusive or w with f 1 1 1 1 1 1 1(2) 1 1(2) 1 1 1 1 1 1 1 1 1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0111 0101 0001 0001 1001 0011 1011 1010 1111 0100 1000 0000 0000 1101 1100 0010 1110 0110 dfff dfff lfff 0000 dfff dfff dfff dfff dfff dfff dfff lfff 0xx0 dfff dfff dfff dfff dfff ffff ffff ffff 0011 ffff ffff ffff ffff ffff ffff ffff ffff 0000 ffff ffff ffff ffff ffff c,dc,z z z z z z z z z c c c,dc,z z 1,2 1,2 2 1,2 1,2 1,2,3 1,2 1,2,3 1,2 1,2 1,2 1,2 1,2 1,2 1,2 bit-oriented file register operations bcf bsf btfsc btfss f, b f, b f, b f, b bit clear f bit set f bit test f, skip if clear bit test f, skip if set 1 1 1 (2) 1 (2) 01 01 01 01 00bb 01bb 10bb 11bb bfff bfff bfff bfff ffff ffff ffff ffff 1,2 1,2 3 3 literal and control operations addlw andlw call clrwdt goto iorlw movlw retfie retlw return sleep sublw xorlw k k k - k k k - k - - k k add literal and w and literal with w call subroutine clear watchdog timer go to address inclusive or literal with w move literal to w return from interrupt return with literal in w return from subroutine go into standby mode subtract w from literal exclusive or literal with w 1 1 2 1 2 1 1 2 2 2 1 1 1 11 11 10 00 10 11 11 00 11 00 00 11 11 111x 1001 0kkk 0000 1kkk 1000 00xx 0000 01xx 0000 0000 110x 1010 kkkk kkkk kkkk 0110 kkkk kkkk kkkk 0000 kkkk 0000 0110 kkkk kkkk kkkk kkkk kkkk 0100 kkkk kkkk kkkk 1001 kkkk 1000 0011 kkkk kkkk c,dc,z z to , pd z to , pd c,dc,z z note 1: when an i/o register is modified as a function of itself ( i.e., movf portb, 1 ), the value used will be that value present on the pins themselves. for example, if the data latch is '1' for a pin configured as input and is driven low by an external device, the data will be written back with a '0'. 2: if this instruction is executed on the tmr0 register (and, where applicable, d = 1), the prescaler will be cleared if assigned to the timer0 module. 3: if program counter (pc) is modified or a conditional test is true, the instruction requires two cycles. the second cycle is executed as a nop .
PIC16C433 ds41139b-page 70 preliminary ? 2002 microchip technology inc. 10.2 instruction descriptions addlw add literal and w syntax: [ label ] addlw k operands: 0 k 255 operation: (w) + k (w) status affected: c, dc, z encoding: 11 111x kkkk kkkk description: the contents of the w register are added to the eight bit literal 'k' and the result is placed in the w register. words: 1 cycles: 1 example addlw 0x15 before instruction w = 0x10 after instruction w = 0x25 addwf add w and f syntax: [ label ] addwf f,d operands: 0 f 127 d [0,1] operation: (w) + (f) (dest) status affected: c, dc, z encoding: 00 0111 dfff ffff description: add the contents of the w register with register 'f'. if 'd' is 0, the result is stored in the w register. if 'd' is 1, the result is stored back in register 'f'. words: 1 cycles: 1 example addwf fsr, 0 before instruction w = 0x17 fsr = 0xc2 after instruction w= 0xd9 fsr = 0xc2 andlw and literal with w syntax: [ label ] andlw k operands: 0 k 255 operation: (w) .and. (k) (w) status affected: z encoding: 11 1001 kkkk kkkk description: the contents of w register are and?ed with the eight bit literal 'k'. the result is placed in the w register. words: 1 cycles: 1 example andlw 0x5f before instruction w= 0xa3 after instruction w = 0x03 andwf and w with f syntax: [ label ] andwf f,d operands: 0 f 127 d [0,1] operation: (w) .and. (f) (dest) status affected: z encoding: 00 0101 dfff ffff description: and the w register with register 'f'. if 'd' is 0, the result is stored in the w register. if 'd' is 1, the result is stored back in register 'f'. words: 1 cycles: 1 example andwf fsr, 1 before instruction w= 0x17 fsr = 0xc2 after instruction w= 0x17 fsr = 0x02
? 2002 microchip technology inc. preliminary ds41139b-page 71 PIC16C433 bcf bit clear f syntax: [ label ] bcf f,b operands: 0 f 127 0 b 7 operation: 0 (f) status affected: none encoding: 01 00bb bfff ffff description: bit 'b' in register 'f' is cleared. words: 1 cycles: 1 example bcf flag_reg, 7 before instruction flag_reg = 0xc7 after instruction flag_reg = 0x47 bsf bit set f syntax: [ label ] bsf f,b operands: 0 f 127 0 b 7 operation: 1 (f) status affected: none encoding: 01 01bb bfff ffff description: bit 'b' in register 'f' is set. words: 1 cycles: 1 example bsf flag_reg, 7 before instruction flag_reg = 0x0a after instruction flag_reg = 0x8a btfsc bit test, skip if clear syntax: [ label ] btfsc f,b operands: 0 f 127 0 b 7 operation: skip if (f) = 0 status affected: none encoding: 01 10bb bfff ffff description: if bit 'b' in register 'f' is '0', then the next instruction is skipped. if bit 'b' is '0', then the next instruc- tion fetched during the current instruction execution is discarded, and a nop is executed instead, making this a 2 cycle instruction. words: 1 cycles: 1(2) example here false true btfsc goto    flag,1 process_code before instruction pc = address here after instruction if flag<1> = 0, pc = address true if flag<1>=1, pc = address false
PIC16C433 ds41139b-page 72 preliminary ? 2002 microchip technology inc. btfss bit test f, skip if set syntax: [ label ] btfss f,b operands: 0 f 127 0 b < 7 operation: skip if (f) = 1 status affected: none encoding: 01 11bb bfff ffff description: if bit 'b' in register 'f' is '1', then the next instruction is skipped. if bit 'b' is '1', then the next instruc- tion fetched during the current instruction execution is discarded and a nop is executed instead, making this a 2-cycle instruction. words: 1 cycles: 1(2) example here false true btfss goto    flag,1 process_code before instruction pc = address here after instruction if flag<1> = 0, pc = address false if flag<1> = 1, pc = address true call call subroutine syntax: [ label ] call k operands: 0 k 2047 operation: (pc)+ 1 tos, k pc<10:0>, (pclath<4:3>) pc<12:11> status affected: none encoding: 10 0kkk kkkk kkkk description: call subroutine. first, return address (pc+1) is pushed onto the stack. the eleven bit immedi- ate address is loaded into pc bits <10:0>. the upper bits of the pc are loaded from pclath. call is a two-cycle instruction. words: 1 cycles: 2 example here call there before instruction pc = address here after instruction pc = address there tos = address here+1 clrf clear f syntax: [ label ] clrf f operands: 0 f 127 operation: 00h (f) 1 z status affected: z encoding: 00 0001 1fff ffff description: the contents of register 'f' are cleared and the z bit is set. words: 1 cycles: 1 example clrf flag_reg before instruction flag_reg = 0x5a after instruction flag_reg = 0x00 z=1 clrw clear w syntax: [ label ] clrw operands: none operation: 00h (w) 1 z status affected: z encoding: 00 0001 0000 0011 description: w register is cleared. zero bit (z) is set. words: 1 cycles: 1 example clrw before instruction w= 0x5a after instruction w= 0x00 z=1
? 2002 microchip technology inc. preliminary ds41139b-page 73 PIC16C433 clrwdt clear watchdog timer syntax: [ label ] clrwdt operands: none operation: 00h wdt 0 wdt prescaler, 1 to 1 pd status affected: to , pd encoding: 00 0000 0110 0100 description: clrwdt instruction resets the watchdog timer. it also resets the prescaler of the wdt. status bits to and pd are set. words: 1 cycles: 1 example clrwdt before instruction wdt counter = ? after instruction wdt counter = 0x00 wdt prescaler= 0 to =1 pd =1 comf complement f syntax: [ label ] comf f,d operands: 0 f 127 d [0,1] operation: (f ) (dest) status affected: z encoding: 00 1001 dfff ffff description: the contents of register 'f' are complemented. if 'd' is 0, the result is stored in w. if 'd' is 1, the result is stored back in register 'f'. words: 1 cycles: 1 example comf reg1,0 before instruction reg1 = 0x13 after instruction reg1 = 0x13 w=0xec decf decrement f syntax: [ label ] decf f,d operands: 0 f 127 d [0,1] operation: (f) - 1 (dest) status affected: z encoding: 00 0011 dfff ffff description: decrement register 'f'. if 'd' is 0, the result is stored in the w regis- ter. if 'd' is 1, the result is stored back in register 'f'. words: 1 cycles: 1 example decf cnt, 1 before instruction cnt = 0x01 z=0 after instruction cnt = 0x00 z=1 decfsz decrement f, skip if 0 syntax: [ label ] decfsz f,d operands: 0 f 127 d [0,1] operation: (f) - 1 (dest); skip if result = 0 status affected: none encoding: 00 1011 dfff ffff description: the contents of register 'f' are decre- mented. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is placed back in register 'f'. if the result is 0, the next instruc- tion, which is already fetched, is discarded. a nop is executed instead making it a two-cycle instruction. words: 1 cycles: 1(2) example here decfsz cnt, 1 goto loop continue    before instruction pc = address here after instruction cnt = cnt - 1 if cnt = 0, pc = address continue if cnt ? 0, pc = address here+1
PIC16C433 ds41139b-page 74 preliminary ? 2002 microchip technology inc. goto unconditional branch syntax: [ label ] goto k operands: 0 k 2047 operation: k pc<10:0> pclath<4:3> pc<12:11> status affected: none encoding: 10 1kkk kkkk kkkk description: goto is an unconditional branch. the eleven-bit immediate value is loaded into pc bits <10:0>. the upper bits of pc are loaded from pclath<4:3>. goto is a two- cycle instruction. words: 1 cycles: 2 example goto there after instruction pc = address there incf increment f syntax: [ label ] incf f,d operands: 0 f 127 d [0,1] operation: (f) + 1 (dest) status affected: z encoding: 00 1010 dfff ffff description: the contents of register 'f' are incremented. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is placed back in register 'f'. words: 1 cycles: 1 example incf cnt, 1 before instruction cnt = 0xff z=0 after instruction cnt = 0x00 z=1
? 2002 microchip technology inc. preliminary ds41139b-page 75 PIC16C433 incfsz increment f, skip if 0 syntax: [ label ] incfsz f,d operands: 0 f 127 d [0,1] operation: (f) + 1 (dest), skip if result = 0 status affected: none encoding: 00 1111 dfff ffff description: the contents of register 'f' are incremented. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is placed back in register 'f'. if the result is 0, the next instruc- tion, which is already fetched, is discarded. a nop is executed instead making it a two-cycle instruction. words: 1 cycles: 1(2) example here incfsz cnt, 1 goto loop continue    before instruction pc = address here after instruction cnt = cnt + 1 if cnt= 0, pc = address continue if cnt 0, pc = address here +1 iorlw inclusive or literal with w syntax: [ label ] iorlw k operands: 0 k 255 operation: (w) .or. k (w) status affected: z encoding: 11 1000 kkkk kkkk description: the contents of the w register are or?ed with the eight bit literal 'k'. the result is placed in the w register. words: 1 cycles: 1 example iorlw 0x35 before instruction w = 0x9a after instruction w= 0xbf z=1 iorwf inclusive or w with f syntax: [ label ] iorwf f,d operands: 0 f 127 d [0,1] operation: (w) .or. (f) (dest) status affected: z encoding: 00 0100 dfff ffff description: inclusive or the w register with register 'f'. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is placed back in register 'f'. words: 1 cycles: 1 example iorwf result, 0 before instruction result = 0x13 w = 0x91 after instruction result = 0x13 w = 0x93 z=1 movlw move literal to w syntax: [ label ] movlw k operands: 0 k 255 operation: k (w) status affected: none encoding: 11 00xx kkkk kkkk description: the eight-bit literal 'k' is loaded into w register. the don?t cares will assemble as 0?s. words: 1 cycles: 1 example movlw 0x5a after instruction w = 0x5a
PIC16C433 ds41139b-page 76 preliminary ? 2002 microchip technology inc. movf move f syntax: [ label ] movf f,d operands: 0 f 127 d [0,1] operation: (f) (dest) status affected: z encoding: 00 1000 dfff ffff description: the contents of register f are moved to a destination dependant upon the status of d. if d = 0, des- tination is w register. if d = 1, the destination is file register f itself. d = 1 is useful to test a file register since status flag z is affected. words: 1 cycles: 1 example movf fsr, 0 after instruction w = value in fsr register z= 1 movwf move w to f syntax: [ label ] movwf f operands: 0 f 127 operation: (w) (f) status affected: none encoding: 00 0000 1fff ffff description: move data from w register to register 'f'. words: 1 cycles: 1 example movwf option before instruction option = 0xff w = 0x4f after instruction option = 0x4f w = 0x4f nop no operation syntax: [ label ] nop operands: none operation: no operation status affected: none encoding: 00 0000 0xx0 0000 description: no operation. words: 1 cycles: 1 example nop option load option register syntax: [ label ] option operands: none operation: (w) option status affected: none encoding: 00 0000 0110 0010 description: the contents of the w register are loaded in the option register. this instruction is supported for code compatibility with pic16c5x products. since option is a read- able/writable register, the user can directly address it. words: 1 cycles: 1 example to maintain upward compatibility with future PIC16C433 products, do not use this instruction.
? 2002 microchip technology inc. preliminary ds41139b-page 77 PIC16C433 retfie return from interrupt syntax: [ label ] retfie operands: none operation: tos pc, 1 gie status affected: none encoding: 00 0000 0000 1001 description: return from interrupt. stack is poped and top-of-stack (tos) is loaded in the pc. interrupts are enabled by setting global inter- rupt enable bit, gie (intcon<7>). this is a two-cycle instruction. words: 1 cycles: 2 example retfie after interrupt pc = tos gie = 1 retlw return with literal in w syntax: [ label ] retlw k operands: 0 k 255 operation: k (w); tos pc status affected: none encoding: 11 01xx kkkk kkkk description: the w register is loaded with the eight-bit literal 'k'. the program counter is loaded from the top of the stack (the return address). this is a two-cycle instruction. words: 1 cycles: 2 example table call table;w contains table ;offset value  ;w now has table value   addwf pc ;w = offset retlw k1 ;begin table retlw k2 ;    retlw kn ; end of table before instruction w = 0x07 after instruction w = value of k8 return return from subroutine syntax: [ label ] return operands: none operation: tos pc status affected: none encoding: 00 0000 0000 1000 description: return from subroutine. the stack is poped and the top of the stack (tos) is loaded into the program counter. this is a two-cycle instruction. words: 1 cycles: 2 example return after interrupt pc = tos
PIC16C433 ds41139b-page 78 preliminary ? 2002 microchip technology inc. rlf rotate left f through carry syntax: [ label ] rlf f,d operands: 0 f 127 d [0,1] operation: see description below status affected: c encoding: 00 1101 dfff ffff description: the contents of register 'f' are rotated one bit to the left through the carry flag. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is stored back in register 'f'. words: 1 cycles: 1 example rlf reg1,0 before instruction reg1 = 1110 0110 c= 0 after instruction reg1 = 1110 0110 w= 1100 1100 c= 1 rrf rotate right f through carry syntax: [ label ] rrf f,d operands: 0 f 127 d [0,1] operation: see description below status affected: c encoding: 00 1100 dfff ffff description: the contents of register 'f' are rotated one bit to the right through the carry flag. if 'd' is 0, the result is placed in the w register. if 'd' is 1, the result is placed back in register 'f'. words: 1 cycles: 1 example rrf reg1,0 before instruction reg1 = 1110 0110 c= 0 after instruction reg1 = 1110 0110 w= 0111 0011 c= 0 register f c register f c sleep syntax: [ label ]sleep operands: none operation: 00h wdt, 0 wdt prescaler, 1 to , 0 pd status affected: to , pd encoding: 00 0000 0110 0011 description: the power-down status bit, pd is cleared. timeout status bit, to is set. watchdog timer and its prescaler are cleared. the processor is put into sleep mode with the oscillator stopped. words: 1 cycles: 1 example: sleep
? 2002 microchip technology inc. preliminary ds41139b-page 79 PIC16C433 sublw subtract w from literal syntax: [ label ]sublw k operands: 0 k 255 operation: k - (w) ( w) status affected: c, dc, z encoding: 11 110x kkkk kkkk description: the w register is subtracted (2?s complement method) from the eight bit literal 'k'. the result is placed in the w register. words: 1 cycles: 1 example 1: sublw 0x02 before instruction w= 1 c= ? after instruction w= 1 c = 1; result is positive example 2: before instruction w= 2 c= ? after instruction w= 0 c = 1; result is zero example 3: before instruction w= 3 c= ? after instruction w= 0xff c = 0; result is negative subwf subtract w from f syntax: [ label ] subwf f,d operands: 0 f 127 d [0,1] operation: (f) - (w) ( dest) status affected: c, dc, z encoding: 00 0010 dfff ffff description: subtract (2?s complement method) w register from register 'f'. if 'd' is 0, the result is stored in the w register. if 'd' is 1, the result is stored back in register 'f'. words: 1 cycles: 1 example 1: subwf reg1,1 before instruction reg1 = 3 w=2 c=? after instruction reg1 = 1 w=2 c = 1; result is positive example 2: before instruction reg1 = 2 w=2 c=? after instruction reg1 = 0 w=2 c = 1; result is zero example 3: before instruction reg1 = 1 w=2 c=? after instruction reg1 = 0xff w=2 c = 0; result is negative
PIC16C433 ds41139b-page 80 preliminary ? 2002 microchip technology inc. swapf swap nibbles in f syntax: [ label ] swapf f,d operands: 0 f 127 d [0,1] operation: (f<3:0>) (dest<7:4>), (f<7:4>) (dest<3:0>) status affected: none encoding: 00 1110 dfff ffff description: the upper and lower nibbles of register 'f' are exchanged. if 'd' is 0, the result is placed in w regis- ter. if 'd' is 1, the result is placed in register 'f'. words: 1 cycles: 1 example swapf reg, 0 before instruction reg1 = 0xa5 after instruction reg1 = 0xa5 w = 0x5a tris load tris register syntax: [ label ] tris f operands: 5 f 7 operation: (w) tris register f; status affected: none encoding: 00 0000 0110 0fff description: the instruction is supported for code compatibility with the pic16c5x products. since tris registers are readable and writ- able, the user can directly address them. words: 1 cycles: 1 example to maintain upward compatibility with future PIC16C433 products, do not use this instruction. xorlw exclusive or literal with w syntax: [ label ]xorlw k operands: 0 k 255 operation: (w) .xor. k ( w) status affected: z encoding: 11 1010 kkkk kkkk description: the contents of the w register are xor?ed with the eight bit lit- eral 'k'. the result is placed in the w register. words: 1 cycles: 1 example: xorlw 0xaf before instruction w= 0xb5 after instruction w = 0x1a xorwf exclusive or w with f syntax: [ label ] xorwf f,d operands: 0 f 127 d [0,1] operation: (w) .xor. (f) ( dest) status affected: z encoding: 00 0110 dfff ffff description: exclusive or the contents of the w register with register 'f'. if 'd' is 0, the result is stored in the w register. if 'd' is 1, the result is stored back in register 'f'. words: 1 cycles: 1 example xorwf reg 1 before instruction reg = 0xaf w=0xb5 after instruction reg = 0x1a w=0xb5
? 2002 microchip technology inc. preliminary ds41139b-page 81 PIC16C433 11.0 development support the picmicro ? microcontrollers are supported with a full range of hardware and software development tools:  integrated development environment - mplab ? ide software  assemblers/compilers/linkers -mpasm tm assembler - mplab c17 and mplab c18 c compilers -mplink tm object linker/ mplib tm object librarian - mplab c30 c compiler - mplab asm30 assembler/linker/library  simulators - mplab sim software simulator - mplab dspic30 software simulator  emulators - mplab ice 2000 in-circuit emulator - mplab ice 4000 in-circuit emulator  in-circuit debugger - mplab icd 2  device programmers -pro mate ? ii universal device programmer - picstart ? plus development programmer  low cost demonstration boards - picdem tm 1 demonstration board - picdem.net tm demonstration board - picdem 2 plus demonstration board - picdem 3 demonstration board - picdem 17 demonstration board - picdem 18r demonstration board - picdem lin demonstration board - picdem usb demonstration board  evaluation kits -k ee l oq ? - picdem msc - microid ? -can - powersmart ? -analog 11.1 mplab integrated development environment software the mplab ide software brings an ease of software development previously unseen in the 8/16-bit micro- controller market. the mplab ide is a windows ? based application that contains:  an interface to debugging tools - simulator - programmer (sold separately) - emulator (sold separately) - in-circuit debugger (sold separately)  a full-featured editor with color coded context  a multiple project manager  customizable data windows with direct edit of contents  high level source code debugging  mouse over variable inspection  extensive on-line help the mplab ide allows you to:  edit your source files (either assembly or c)  one touch assemble (or compile) and download to picmicro emulator and simulator tools (automatically updates all project information)  debug using: - source files (assembly or c) - absolute listing file (mixed assembly and c) - machine code mplab ide supports multiple debugging tools in a single development paradigm, from the cost effective simulators, through low cost in-circuit debuggers, to full-featured emulators. this eliminates the learning curve when upgrading to tools with increasing flexibility and power. 11.2 mpasm assembler the mpasm assembler is a full-featured, universal macro assembler for all picmicro mcus. the mpasm assembler generates relocatable object files for the mplink object linker, intel ? standard hex files, map files to detail memory usage and symbol ref- erence, absolute lst files that contains source lines and generated machine code and coff files for debugging. the mpasm assembler features include:  integration into mplab ide projects  user defined macros to streamline assembly code  conditional assembly for multi-purpose source files  directives that allow complete control over the assembly process
PIC16C433 ds41139b-page 82 preliminary ? 2002 microchip technology inc. 11.3 mplab c17 and mplab c18 c compilers the mplab c17 and mplab c18 code development systems are complete ansi c compilers for microchip?s pic17cxxx and pic18cxxx family of microcontrollers. these compilers provide powerful integration capabilities, superior code optimization and ease of use not found with other compilers. for easy source level debugging, the compilers provide symbol information that is optimized to the mplab ide debugger. 11.4 mplink object linker/ mplib object librarian the mplink object linker combines relocatable objects created by the mpasm assembler and the mplab c17 and mplab c18 c compilers. it can link relocatable objects from pre-compiled libraries, using directives from a linker script. the mplib object librarian manages the creation and modification of library files of pre-compiled code. when a routine from a library is called from a source file, only the modules that contain that routine will be linked in with the application. this allows large libraries to be used efficiently in many different applications. the object linker/library features include:  efficient linking of single libraries instead of many smaller files  enhanced code maintainability by grouping related modules together  flexible creation of libraries with easy module listing, replacement, deletion and extraction 11.5 mplab c30 c compiler the mplab c30 c compiler is a full-featured, ansi compliant, optimizing compiler that translates standard ansi c programs into dspic30f assembly language source. the compiler also supports many command- line options and language extensions to take full advantage of the dspic30f device hardware capabili- ties, and afford fine control of the compiler code generator. mplab c30 is distributed with a complete ansi c standard library. all library functions have been vali- dated and conform to the ansi c library standard. the library includes functions for string manipulation, dynamic memory allocation, data conversion, time- keeping, and math functions (trigonometric, exponen- tial and hyperbolic). the compiler provides symbolic information for high level source debugging with the mplab ide. 11.6 mplab asm30 assembler, linker, and librarian mplab asm30 assembler produces relocatable machine code from symbolic assembly language for dspic30f devices. mplab c30 compiler uses the assembler to produce it?s object file. the assembler generates relocatable object files that can then be archived or linked with other relocatable object files and archives to create an executable file. notable features of the assembler include:  support for the entire dspic30f instruction set  support for fixed-point and floating-point data  command line interface  rich directive set  flexible macro language  mplab ide compatibility 11.7 mplab sim software simulator the mplab sim software simulator allows code devel- opment in a pc hosted environment by simulating the picmicro series microcontrollers on an instruction level. on any given instruction, the data areas can be examined or modified and stimuli can be applied from a file, or user defined key press, to any pin. the execu- tion can be performed in single-step, execute until break, or trace mode. the mplab sim simulator fully supports symbolic debugging using the mplab c17 and mplab c18 c compilers, as well as the mpasm assembler. the software simulator offers the flexibility to develop and debug code outside of the laboratory environment, making it an excellent, economical software development tool. 11.8 mplab sim30 software simulator the mplab sim30 software simulator allows code development in a pc hosted environment by simulating the dspic30f series microcontrollers on an instruction level. on any given instruction, the data areas can be examined or modified and stimuli can be applied from a file, or user defined key press, to any of the pins. the mplab sim30 simulator fully supports symbolic debugging using the mplab c30 c compiler and mplab asm30 assembler. the simulator runs in either a command line mode for automated tasks, or from mplab ide. this high speed simulator is designed to debug, analyze and optimize time intensive dsp routines.
? 2002 microchip technology inc. preliminary ds41139b-page 83 PIC16C433 11.9 mplab ice 2000 high performance universal in-circuit emulator the mplab ice 2000 universal in-circuit emulator is intended to provide the product development engineer with a complete microcontroller design tool set for picmicro microcontrollers. software control of the mplab ice 2000 in-circuit emulator is advanced by the mplab integrated development environment, which allows editing, building, downloading and source debugging from a single environment. the mplab ice 2000 is a full-featured emulator sys- tem with enhanced trace, trigger and data monitoring features. interchangeable processor modules allow the system to be easily reconfigured for emulation of differ- ent processors. the universal architecture of the mplab ice in-circuit emulator allows expansion to support new picmicro microcontrollers. the mplab ice 2000 in-circuit emulator system has been designed as a real-time emulation system with advanced features that are typically found on more expensive development tools. the pc platform and microsoft ? windows 32-bit operating system were chosen to best make these features available in a simple, unified application. 11.10 mplab ice 4000 high performance universal in-circuit emulator the mplab ice 4000 universal in-circuit emulator is intended to provide the product development engineer with a complete microcontroller design tool set for high- end picmicro microcontrollers. software control of the mplab ice in-circuit emulator is provided by the mplab integrated development environment, which allows editing, building, downloading and source debugging from a single environment. the mplab icd 4000 is a premium emulator system, providing the features of mplab ice 2000, but with increased emulation memory and high speed perfor- mance for dspic30f and pic18xxxx devices. its advanced emulator features include complex triggering and timing, up to 2 mb of emulation memory, and the ability to view variables in real-time. the mplab ice 4000 in-circuit emulator system has been designed as a real-time emulation system with advanced features that are typically found on more expensive development tools. the pc platform and microsoft windows 32-bit operating system were cho- sen to best make these features available in a simple, unified application. 11.11 mplab icd 2 in-circuit debugger microchip?s in-circuit debugger, mplab icd 2, is a powerful, low cost, run-time development tool, connecting to the host pc via an rs-232 or high speed usb interface. this tool is based on the flash picmicro mcus and can be used to develop for these and other picmicro microcontrollers. the mplab icd 2 utilizes the in-circuit debugging capability built into the flash devices. this feature, along with microchip?s in-circuit serial programming tm (icsp tm ) protocol, offers cost effective in-circuit flash debug- ging from the graphical user interface of the mplab integrated development environment. this enables a designer to develop and debug source code by setting breakpoints, single-stepping and watching variables, cpu status and peripheral registers. running at full speed enables testing hardware and applications in real-time. mplab icd 2 also serves as a development programmer for selected picmicro devices. 11.12 pro mate ii universal device programmer the pro mate ii is a universal, ce compliant device programmer with programmable voltage verification at v ddmin and v ddmax for maximum reliability. it features an lcd display for instructions and error messages and a modular detachable socket assembly to support various package types. in stand-alone mode, the pro mate ii device programmer can read, verify, and program picmicro devices without a pc connection. it can also set code protection in this mode. 11.13 picstart plus development programmer the picstart plus development programmer is an easy-to-use, low cost, prototype programmer. it con- nects to the pc via a com (rs-232) port. mplab integrated development environment software makes using the programmer simple and efficient. the picstart plus development programmer supports most picmicro devices up to 40 pins. larger pin count devices, such as the pic16c92x and pic17c76x, may be supported with an adapter socket. the picstart plus development programmer is ce compliant.
PIC16C433 ds41139b-page 84 preliminary ? 2002 microchip technology inc. 11.14 picdem 1 picmicro demonstration board the picdem 1 demonstration board demonstrates the capabilities of the pic16c5x (pic16c54 to pic16c58a), pic16c61, pic16c62x, pic16c71, pic16c8x, pic17c42, pic17c43 and pic17c44. all necessary hardware and software is included to run basic demo programs. the sample microcontrollers provided with the picdem 1 demonstration board can be programmed with a pro mate ii device program- mer, or a picstart plus development programmer. the picdem 1 demonstration board can be connected to the mplab ice in-circuit emulator for testing. a pro- totype area extends the circuitry for additional applica- tion components. features include an rs-232 interface, a potentiometer for simulated analog input, push button switches and eight leds. 11.15 picdem.net internet/ethernet demonstration board the picdem.net demonstration board is an internet/ ethernet demonstration board using the pic18f452 microcontroller and tcp/ip firmware. the board supports any 40-pin dip device that conforms to the standard pinout used by the pic16f877 or pic18c452. this kit features a user friendly tcp/ip stack, web server with html, a 24l256 serial eeprom for xmodem download to web pages into serial eeprom, icsp/mplab icd 2 interface con- nector, an ethernet interface, rs-232 interface, and a 16 x 2 lcd display. also included is the book and cd-rom ?tcp/ip lean, web servers for embedded systems,? by jeremy bentham 11.16 picdem 2 plus demonstration board the picdem 2 plus demonstration board supports many 18-, 28-, and 40-pin microcontrollers, including pic16f87x and pic18fxx2 devices. all the neces- sary hardware and software is included to run the dem- onstration programs. the sample microcontrollers provided with the picdem 2 demonstration board can be programmed with a pro mate ii device program- mer, picstart plus development programmer, or mplab icd 2 with a universal programmer adapter. the mplab icd 2 and mplab ice in-circuit emulators may also be used with the picdem 2 demonstration board to test firmware. a prototype area extends the circuitry for additional application components. some of the features include an rs-232 interface, a 2 x 16 lcd display, a piezo speaker, an on-board temperature sensor, four leds, and sample pic18f452 and pic16f877 flash microcontrollers. 11.17 picdem 3 pic16c92x demonstration board the picdem 3 demonstration board supports the pic16c923 and pic16c924 in the plcc package. all the necessary hardware and software is included to run the demonstration programs. 11.18 picdem 17 demonstration board the picdem 17 demonstration board is an evaluation board that demonstrates the capabilities of several microchip microcontrollers, including pic17c752, pic17c756a, pic17c762 and pic17c766. a pro- grammed sample is included. the pro mate ii device programmer, or the picstart plus development pro- grammer, can be used to reprogram the device for user tailored application development. the picdem 17 demonstration board supports program download and execution from external on-board flash memory. a generous prototype area is available for user hardware expansion.
? 2002 microchip technology inc. preliminary ds41139b-page 85 PIC16C433 11.19 picdem 18r pic18c601/801 demonstration board the picdem 18r demonstration board serves to assist development of the pic18c601/801 family of microchip microcontrollers. it provides hardware implementation of both 8-bit multiplexed/de-multiplexed and 16-bit memory modes. the board includes 2 mb external flash memory and 128 kb sram memory, as well as serial eeprom, allowing access to the wide range of memory types supported by the pic18c601/801. 11.20 picdem lin pic16c43x demonstration board the powerful lin hardware and software kit includes a series of boards and three picmicro microcontrollers. the small footprint pic16c432 and PIC16C433 are used as slaves in the lin communication and feature on-board lin transceivers. a pic16f874 flash microcontroller serves as the master. all three micro- controllers are programmed with firmware to provide lin bus communication. 11.21 picdem usb pic16c7x5 demonstration board the picdem usb demonstration board shows off the capabilities of the pic16c745 and pic16c765 usb microcontrollers. this board provides the basis for future usb products. 11.22 evaluation and programming tools in addition to the picdem series of circuits, microchip has a line of evaluation kits and demonstration software for these products. k ee l oq evaluation and programming tools for microchip?s hcs secure data products  can developers kit for automotive network applications  analog design boards and filter design software  powersmart battery charging evaluation/ calibration kits irda ? development kit  microid development and rflab tm development software  seeval ? designer kit for memory evaluation and endurance calculations  picdem msc demo boards for switching mode power supply, high power ir driver, delta sigma adc, and flow rate sensor check the microchip web page and the latest product line card for the complete list of demonstration and evaluation kits.
PIC16C433 ds41139b-page 86 preliminary ? 2002 microchip technology inc. table 11-1: development tools from microchip pic12cxxx pic12fxxx pic14000 pic16c5x pic16c6x pic16cxxx pic16c43x pic16f62x pic16c7x pic16c7xx pic16c7x5 pic16c8x pic16f8xx pic16c9xx pic17c4x pic17c7xx pic18cxx2 pi18cx01 pic18fxxx dspic30f software tools mplab integrated development environment   mplab c17 c compiler  mplab c18 c compiler  mpasm assembler/ mplink object linker   mplab c30 c compiler  mplab asm30 assembler/linker/librarian  emulators mplab ice 2000 in-circuit emulator  **   mplab ice 4000 in-circuit emulator    debugger mplab icd 2 in-circuit debugger  *  *  programmers picstart plus entry level development programmer  **   pro mate ii universal device programmer  **   demo boards and eval kits picdem 1 demonstration board   ?  picdem.net demonstration board  picdem 2 plus demonstration board  ?  ?  picdem 3 demonstration board  picdem 14a demonstration board  picdem 17 demonstration board  picdem 18r demonstration board  picdem lin demonstration board  picdem usb demonstration board  * contact the microchip web site at www.microchip.com for information on how to use the mplab icd in-circuit debugger (dv164001) with pic16c62, 63, 64, 65, 72, 73, 74, 76, 77. ** contact microchip technology inc. for availability date. ? development tool is available on select devices.
? 2002 microchip technology inc. preliminary ds41139b-page 87 PIC16C433 12.0 electrical specifications for PIC16C433 absolute maximum ratings ? ambient temperature under bias ................................................................................................. ............. -40 to +125 c storage temperature ............................................................................................................ .................... -65 to +150 c voltage on any pin with respect to v ss (except v dd and mclr ) .......................................................-0.6v to v dd +0.6v voltage on v dd with respect to v ss ................................................................................................................ 0 to +7.0v voltage on mclr with respect to v ss * ..............................................................................................................0 to +14v voltage on lin and v bat with respect to v ss .............................................................................................................40v total power dissipation ........................................................................................................ .....................................1.0w maximum current out of v ss pin ..........................................................................................................................3 00 ma maximum current into v dd pin ........................................................................................................................... ..250 ma input clamp current, i ik (v i <0 or v i > v dd ) ...................................................................................................................... 20 ma output clamp current, i ok (v o <0 or v o >v dd ) ................................................................................................................ 20 ma maximum output current sunk by any i/o pin ..................................................................................... ...................25 ma maximum output current sourced by v dd (sourced by v dd ) .................................................................................25 ma maximum output current sourced by any i/o pin (sourced by v dd ) ......................................................................25 ma maximum current sunk by gpio (sourced by v dd )..............................................................................................200 ma maximum current sourced by gpio (sourced by v dd ) ........................................................................................200 ma maximum current sourced by v bat (sourced by v bat ) ........................................................................................200 ma maximum current sunk by lin (sourced by v bat )................................................................................................200 ma maximum current sunk by bact................................................................................................... ........................1.8 ma * voltage spikes below v ss at the mclr pin, inducing currents greater than 80 ma, may cause latchup. thus, a series resistor of 50-100 ? should be used when applying a low level to the mclr pin, rather than pulling this pin directly to v ss .. ? notice : stresses above those listed under "absolute maximum ratings" may cause permanent damage to the device. this is a stress rating only and functional operation of the device at those or any other conditions, above those indicated in the operation listings of this specification, is not implied. exposure to maximum rating conditions for extended periods may affect device reliability.
PIC16C433 ds41139b-page 88 preliminary ? 2002 microchip technology inc. figure 12-1: PIC16C433 voltage-frequency graph, -40 c t a +125 c 6.0 2.5 4.0 3.0 0 3.5 4.5 5.0 5.5 410 frequency (mhz) v dd 20 (volts) 25 2.0 note 1: the shaded region indicates the permissible combinations of voltage and frequency. 2: the maximum rated speed of the part limits the permissible combinations of voltage and frequency. please reference the product identification system, page 123 for the maximum rated speed of the parts.
? 2002 microchip technology inc. preliminary ds41139b-page 89 PIC16C433 12.1 d c characteristics PIC16C433 (industrial, extended) dc characteristics standard operating conditions (unless otherwise specified) operating temperature -40c t a +85c for industrial -40c t a +125c for extended parm no. sym characteristic min typ? max units conditions d001 v dd supply voltage 4.5 5.5 v d001a v bat operating battery voltage 8.0 13.8 18 v d002 v dr ram data retention voltage (note 1) 1.5* v device in sleep mode d003 v por v dd start voltage to ensure power-on reset v ss v see section 9.4 for details d004 s vdd v dd rise rate to ensure power-on reset 0.05* v/ms see section 9.4 for details d010 d010c d010a i dd supply current (note 2) ? ? ? ? 1.2 1.2 2.2 ? 3.5 3.5 9 ? ma ma ma ? f osc = 4 mhz, v dd = 4.5v xt and extrc mode (note 3) f osc = 4 mhz, v dd = 4.5v intrc mode (note 5) f osc = 10 mhz, v dd = 5.5v hs mode d020 d021 d021b i pd power-down current (note 4) ? ? ? ? 0.25 2 0.8 3 7 14 9 16 a a a a v dd = 4.5v, industrial, wdt disabled v dd = 4.5v, extended, wdt disabled v dd = 5.5v, industrial, wdt disabled v dd = 5.5v, extended, wdt disabled d022 ? i wdt watchdog timer current ? ? ? 2.2 2.2 4 5 6 11 a a a v dd = 4.5v, commercial v dd = 4.5v, industrial v dd = 4.5v, extended * these parameters are characterized but not tested. ? data in typical (?typ?) column is based on characterization results at 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: this is the limit to which v dd can be lowered in sleep mode without losing ram data. 2: the supply current is mainly a function of the operating voltage and frequency. other factors such as bus loading, oscillator type, bus rate, internal code execution pattern and temperature, also have an impact on the current consumption. a) the test conditions for all i dd measurements in active operation mode are: osc1 = external square wave, from rail-to-rail; all i/o pins tri-stated, pulled to v ss , t0cki = v dd , mclr = v dd ; wdt disabled. b) for standby current measurements, the conditions are the same, except that the device is in sleep mode. c) i dd values include lin bus transceiver current as defined by d313 in table 12-1. 3: for extrc osc configuration, current through r ext is not included. the current through the resistor can be estimated by the formula: ir = v dd /2r ext (ma) with r ext in kohm. 4: the power-down current in sleep mode does not depend on the oscillator type. power-down current is measured with the part in sleep mode, with all i/o pins in hi-impedance state and tied to v dd or v ss . however, the lin bus transceiver will still draw current. please refer to table 12-1. 5: intrc calibration value is for 4 mhz nominal at 5v, 25c.
PIC16C433 ds41139b-page 90 preliminary ? 2002 microchip technology inc. 12.2 dc characteristics: PIC16C433 (industrial, extended) dc characteristics standard operating conditions (unless otherwise specified) operating temperature -40c t a +85c (industrial) -40c t a +125c (extended) operating voltage v dd range as described in dc spec section 12.1. param no. characteristic sym min typ? max units conditions input low voltage i/o ports v il d030 with ttl buffer v ss ? 0.8v v for 4.5v v dd 5.5v v ss ? 0.15v dd v otherwise d031 with schmitt trigger buffer v ss ? 0.2v dd v d032 mclr , gp2/t0cki/an2/int (in extrc mode) v ss ? 0.2v dd v d033 osc1 (in extrc mode) v ss ? 0.2v dd (note 1) d033 osc1 (in xt, hs, and lp) v ss ? 0.3v dd v (note 1) input high voltage i/o ports v ih ? d040 with ttl buffer 2.0v ? v dd v 4.5v v dd 5.5v d040a 0.25v dd + 0.8v ? v dd v otherwise d041 with schmitt trigger buffer 0.8v dd ? v dd v for entire v dd range d042 mclr , gp2/t0cki/an2/int 0.8v dd ? v dd v d042a osc1 (xt, hs, and lp) 0.7v dd ? v dd v (note 1) d043 osc1 (in extrc mode) 0.9v dd ? v dd v input leakage current (notes 2, 3) d060 i/o ports i il ?? + 1 av ss v pin v dd , pin at hi-impedance d061 gp3/mclr (note 5) ?? + 30 av ss v pin v dd d061a gp3 (note 6) ?? + 5 av ss v pin v dd d062 gp2/t0cki ?? + 5 av ss v pin v dd d063 osc1 ?? + 5 av ss v pin v dd , xt, hs, and lp osc configuration d070 gpio weak pull-up current (note 4) i pur 50 250 400 av dd = 5v, v pin = v ss mclr pull-up current ??? 30 av dd = 5v, v pin = v ss output low voltage d080 i/o ports v ol ?? 0.6 v i ol = 8.5 ma, v dd = 4.5v, -40 c to +85 c d080a ?? 0.6 v i ol = 7.0 ma, v dd = 4.5v, -40 c to +125 c d083 osc2/clkout ? ? 0.6 v i ol = 1.6 ma, v dd = 4.5v, -40 c to +85 c d083a ? ? 0.6 v i ol = 1.2 ma, v dd = 4.5v, -40 c to +125 c d084 bact ? ? 1.0 v ? data in ?typ? column is at 5v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: in extrc oscillator configuration, the osc1/clkin pin is a schmitt trigger input. it is not recommended that the PIC16C433 be driven with external clock in rc mode. 2: the leakage current on the mclr pin is strongly dependent on the applied voltage level. the specified levels represent normal operating conditions. higher leakage current may be measured at different input voltages. 3: negative current is defined as coming out of the pin. 4: does not include gp3. for gp3 see parameters d061 and d061a. 5: this specification applies to gp3/mclr configured as external mclr and gp3/mclr configured as input with inter- nal pull-up enabled. 6: this spec. applies when gp3/mclr is configured as an input with pull-up disabled. the leakage current of the mclr circuit is higher than the standard i/o logic. 7: lin characterized 4 mhz, 14.44 v bat , 5.0v v dd . these parameters are characterized but not tested.
? 2002 microchip technology inc. preliminary ds41139b-page 91 PIC16C433 12.2 dc characteristics: PIC16C433 (industrial, extended) - continued dc characteristics standard operating conditions (unless otherwise specified) operating temperature -40c t a +85c (industrial) -40c t a +125c (extended) operating voltage v dd range as described in dc spec section 12.1. param no. characteristic sym min typ? max units conditions output high voltage d090 i/o ports (note 3) v oh v dd - 0.7 ?? vi oh = -3.0 ma, v dd = 4.5v, -40 c to +85 c d090a v dd - 0.7 ?? vi oh = -2.5 ma, v dd = 4.5v, -40 c to +125 c d092 osc2/clkout v dd - 0.7 ? ? v i oh = 1.3 ma, v dd = 4.5v, -40 c to +85 c d092a v dd - 0.7 ? ? v i oh = 1.0 ma, v dd = 4.5v, -40 c to +125 c d093 bact 4.0 ? ? v i oh = 1.8 ma, v dd = 5.0v capacitive loading specs on output pins d100 osc2 pin c osc 2 ?? 15 pf in xt and lp modes when external clock is used to drive osc1 d100a lin c lin ?? 50 pf (note 7, 8) d100b bact c bact ?? 50 pf d101 all i/o pins c io ?? 50 pf ? data in ?typ? column is at 5v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: in extrc oscillator configuration, the osc1/clkin pin is a schmitt trigger input. it is not recommended that the PIC16C433 be driven with external clock in rc mode. 2: the leakage current on the mclr pin is strongly dependent on the applied voltage level. the specified levels represent normal operating conditions. higher leakage current may be measured at different input voltages. 3: negative current is defined as coming out of the pin. 4: does not include gp3. for gp3 see parameters d061 and d061a. 5: this specification applies to gp3/mclr configured as external mclr and gp3/mclr configured as input with inter- nal pull-up enabled. 6: this specification applies when gp3/mclr is configured as an input with pull-up disabled. the leakage current of the mclr circuit is higher than the standard i/o logic. 7: lin characterized 4 mhz, 14.44 v bat , 5.0v v dd . these parameters are characterized but not tested. 8: this parameter is characterized, but not tested.
PIC16C433 ds41139b-page 92 preliminary ? 2002 microchip technology inc. table 12-1: lin transceiver operating specifications operating conditions: v dd range as described in table 12-1, -40 c < t a < +125 c. table 12-2: lin transceiver interface specifications operating conditions: v dd range as described in table 12-1, -40 c ? 2002 microchip technology inc. preliminary ds41139b-page 93 PIC16C433 12.3 timing parameter symbology the timing parameter symbols have been created following one of the following formats: figure 12-2: load conditions 1. tpps2pps 2. tpps t f frequency t time lowercase letters (pp) and their meanings: pp cc ccp1 osc osc1 ck clkout rd rd cs cs rw rd or wr di sdi sc sck do sdo ss ss dt data in t0 t0cki io i/o port t1 t1cki mc mclr wr wr uppercase letters and their meanings: s f fall p period hhigh rrise i invalid (hi-impedance) v valid l low z hi-impedance v dd /2 c l r l pin pin v ss v ss c l r l =464 ? r l master = 900 ? minimum c l = 50 pf for all pins except osc2 1000 ? typical 15 pf for osc2 output 1100 ? maximum load condition 1 load condition 2 r l v bat 550 pf - 10 nf
PIC16C433 ds41139b-page 94 preliminary ? 2002 microchip technology inc. 12.4 timing diagrams and specifications figure 12-3: external clock timing osc1 clkout q4 q1 q2 q3 q4 q1 1 2 3 3 4 4 table 12-3: clock timing requirements parameter no. sym characteristic min typ? max units conditions f osc external clkin frequency (note 1) dc ? 4 mhz xt and extrc osc mode dc ? 4 mhz hs osc mode dc ? 10 mhz hs osc mode dc ? 200 khz lp osc mode oscillator frequency (note 1) dc ? 4 mhz extrc osc mode .455 ? 4 mhz xt osc mode 4 ? 4 mhz hs osc mode 4 ? 10 mhz hs osc mode 5 ? 200 khz lp osc mode 1t osc external clkin period (note 1) 250 ? ? ns xt and extrc osc mode 250 ? ? ns hs osc mode 100 ? ? ns hs osc mode 5? ? s lp osc mode oscillator period (note 1) 250 ? ? ns extrc osc mode 250 ? 10,000 ns xt osc mode 250 ? 250 ns hs osc mode 100 ? 250 ns hs osc mode 5? ? s lp osc mode 2t cy instruction cycle time (note 1) 400 ? dc ns t cy = 4/f osc 3 tosl, to s h external clock in (osc1) high or low time 50 ? ? ns xt oscillator 2.5 ? ? s lp oscillator 10 ? ? ns hs oscillator 4tosr, to s f external clock in (osc1) rise or fall time ? ? 25 ns xt oscillator ? ? 50 ns lp oscillator ? ? 15 ns hs oscillator ? data in typ column is at 5v, 25c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: instruction cycle period (t cy ) equals four times the input oscillator time-base period. all specified values are based on characterization data for that particular oscillator type under standard operating conditions with the device exe- cuting code. exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected current consumption. all devices are tested to operate at min. values with an external clock applied to the osc1/clkin pin. when an external clock input is used, the max . cycle time limit is dc (no clock) for all devices. osc2 is discon- nected (has no loading) for the PIC16C433.
? 2002 microchip technology inc. preliminary ds41139b-page 95 PIC16C433 table 12-4: calibrated internal rc frequencies - PIC16C433 ac characteristics standard operating conditions (unless otherwise specified) operating temperature -40 c t a +85 c (industrial) operating voltage v dd range is described in section 10.1. parameter no. sym characteristic min* typ (1) max* units conditions internal calibrated rc frequency 3.65 4.00 4.28 mhz v dd = 5.0v * these parameters are characterized but not tested. note 1: data in the typical (?typ?) column is at 5v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested.
PIC16C433 ds41139b-page 96 preliminary ? 2002 microchip technology inc. figure 12-4: clkout and i/o timing table 12-5: clkout and i/o timing requirements param no. sym characteristic min typ? max units conditions 10* tosh2ckl osc1 to clkout ? 75 200 ns (note 1) 11* tosh2ckh osc1 to clkout ? 75 200 ns (note 1) 12* tckr clkout rise time ? 35 100 ns (note 1) 13* tckf clkout fall time ? 35 100 ns (note 1) 14* tckl2iov clkout to port out valid ? ? 0.5t cy + 20 ns (note 1) 15* tiov2ckh port in valid before clkout t osc + 200 ? ? ns (note 1) 16* tckh2ioi port in hold after clkout 0??ns (note 1) 17* tosh2iov osc1 (q1 cycle) to port out valid ? 50 150 ns 18* tosh2ioi osc1 (q2 cycle) to port input invalid (i/o in hold time) 100 ? ? ns 19* tiov2osh port input valid to osc1 (i/o in setup time) 0??ns 20* tior port output rise time ? 10 40 ns 21* tiof port output fall time ? 10 40 ns 22??* tinp gp2/int pin high or low time t cy ??ns 23??* trbp gp0/gp1/gp3 change int high or low time t cy ??ns * these parameters are characterized but not tested. ? data in typ column is at 5v, 25c unless otherwise stated. these parameters are for design guidance only and are not tested. ?? these parameters are asynchronous events not related to any internal clock edge. note 1: measurements are taken in extrc and intrc modes where clkout output is 4 x t osc . note: refer to figure 12-2 for load conditions. osc1 clkout i/o pin (input) i/o pin (output) q4 q1 q2 q3 10 13 14 17 20, 21 19 18 15 11 12 16 old value new value
? 2002 microchip technology inc. preliminary ds41139b-page 97 PIC16C433 figure 12-5: reset, watchdog timer, oscillator start-up timer, and power-up timer timing table 12-6: reset, watchdog timer, oscillator start-up timer, power-up timer v dd mclr internal por pwrt timeout osc timeout internal reset watchdog timer reset 33 32 30 31 34 i/o pins 34 36 parameter no. sym characteristic min typ? max units conditions 30 tmcl mclr pulse width (low) 2 ? ? sv dd = 5v, -40c to +125c 31* twdt watchdog timer timeout period (no prescaler) 71833msv dd = 5v, -40c to +125c 32 tost oscillation start-up timer period ? 1024t osc ??t osc = osc1 period 33* tpwrt power up timer period 28 72 132 ms v dd = 5v, -40c to +125c 34 tioz i/o hi-impedance from mclr low or watchdog timer reset ??2.1 s * these parameters are characterized but not tested. ? data in typ column is at 5v, 25c unless otherwise stated. these parameters are for design guidance only and are not tested.
PIC16C433 ds41139b-page 98 preliminary ? 2002 microchip technology inc. figure 12-6: timer0 clock timings table 12-7: timer0 and timer1 external clock requirements param no. sym characteristic min typ? max units conditions 40* tt0h t0cki high pulse width no prescaler 0.5t cy + 20 ? ? ns must also meet parameter 42 with prescaler 10 ? ? ns 41* tt0l t0cki low pulse width no prescaler 0.5t cy + 20 ? ? ns must also meet parameter 42 with prescaler 10 ? ? ns 42* tt0p t0cki period no prescaler t cy + 40 ? ? ns with prescaler greater of: 20 or t cy + 40 n ? ? ns n = prescale value (2, 4,..., 256) 48 tcke2tmr1 delay from external clock edge to timer increment 2t osc ?7t osc ? * these parameters are characterized but not tested. ? data in typ column is at 5v, 25c unless otherwise stated. these parameters are for design guidance only and are not tested. note: refer to figure 12-2 for load conditions. 41 42 40 gp2/t0cki tmr0
? 2002 microchip technology inc. preliminary ds41139b-page 99 PIC16C433 table 12-8: gpio pull-up resistor ranges v dd (volts) temperature ( c) min typ max units gp0/gp1 4.5 -40 38k 42k 63k ? 25 42k 48k 63k ? 85 42k 49k 63k ? 125 50k 55k 63k ? 5.5 -40 15k 17k 20k ? 25 18k 20k 23k ? 85 19k 22k 25k ? 125 22k 24k 28k ? gp3 4.5 -40 285k 346k 417k ? 25 343k 414k 532k ? 85 368k 457k 532k ? 125 431k 504k 593k ? 5.5 -40 247k 292k 360k ? 25 288k 341k 437k ? 85 306k 371k 448k ? 125 351k 407k 500k ? * these parameters are characterized but not tested.
PIC16C433 ds41139b-page 100 preliminary ? 2002 microchip technology inc. table 12-9: lin bus ac characteristics table 12-10: lin thermal characteristics symbol parameter min. typ. max. unit note ? dv/dt ? slope rising and falling edges 123v/ s (note 1) t trans_pd propagation delay of transmitter 4 st trans_pd = max(t trans_pdr or t trans_pdf ) t rec_pd propagation delay of receiver 6 st rec_pd = max(t rec_pdr or t rec_pdf ) t rec_sym symmetry of receiver propagation delay rising edge w.r.t. falling edge -2 2 st rec_sym = t rec_pdf - t rec_pdr) t trans_sym symmetry of transmitter propagation delay rising edge w.r.t. falling edge -2 2 st trans_sym = t trans_pdf - t rans_pdr ) (note 2) note 1: rising edge is system dependent. value is characterized but not tested. 2: system dependent. symbol parameter typ. max. unit note recovery recovery temperature +135 c information parameter shutdown shutdown temperature +155 c information parameter t therm short circuit recovery time 1.5 ms information parameter
? 2002 microchip technology inc. preliminary ds41139b-page 101 PIC16C433 figure 12-7: timing diagram txd (input of physical layer) t trans_pdf t trans_pdr bus signal rec. threshold rec. threshold t rec_pdf t rec_pdr rxd (physical layer output)
PIC16C433 ds41139b-page 102 preliminary ? 2002 microchip technology inc. table 12-11: a/d converter characteristics: param no. sym characteristic min typ? max units conditions a01 n r resolution ? ? 8 bits bit v ref = v dd = 5.12v, v ss v ain v ref a02 e abs total absolute error ? ? < 1 lsb v ref = v dd = 5.12v, v ss v ain v ref a03 e il integral linearity error ? ? < 1 lsb v ref = v dd = 5.12v, v ss v ain v ref a04 e dl differential linearity error ? ? < 1 lsb v ref = v dd = 5.12v, v ss v ain v ref a05 e fs full scale error ? ? < 1 lsb v ref = v dd = 5.12v, v ss v ain v ref a06 e off offset error ? ? < 1 lsb v ref = v dd = 5.12v, v ss v ain v ref a10 ? monotonicity ? guaranteed (note 3) ??v ss v ain v ref a20 v ref reference voltage 2.5v ? v dd + 0.3 v a25 v ain analog input voltage v ss - 0.3 ? v ref + 0.3 v a30 z ain recommended impedance of analog voltage source ? ? 10.0 k ? a40 i ad a/d conversion current (v dd ) ? 180 ? a average current consumption when a/d is on (note 1) a50 i ref v ref input current (note 2) 10 ? ? ? 1000 10 a a during v ain acquisition. based on differential of v hold to v ain to charge c hold , see section 8.1. during a/d conversion cycle * these parameters are characterized but not tested. ? data in ?typ? column is at 5v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. note 1: when a/d is off, it will not consume any current other than minor leakage current. the power-down current spec includes any such leakage from the a/d module. 2: v ref current is from gp1 pin or v dd pin, whichever is selected as reference input. 3: the a/d conversion result never decreases with an increase in the input voltage, and has no missing codes.
? 2002 microchip technology inc. preliminary ds41139b-page 103 PIC16C433 figure 12-8: a/d conversion timing table 12-12: a/d conversion requirements 131 130 132 bsf adcon0, go q4 a/d clk a/d data adres adif go sample old_data sampling stopped done new_data (t osc /2) (1) 7 6 5432 10 note 1: if the a/d clock source is selected as rc, a time of t cy is added before the a/d clock starts. this allows the sleep instruction to be executed. 1 t cy 134 param no. sym characteristic min typ? max units conditions 130 t ad a/d clock period 1.6 ? ? st osc based, v ref 2.5v 2.0 4.0 6.0 s a/d rc mode 3.0 6.0 9.0 s a/d rc mode 131 t cnv conversion time (not including s/h time) (note 1) 11 ? 11 tad 132 t acq acquisition time (note 2) 5* 20 ? ? ? s s the minimum time is the amplifier setting time. this may be used if the new input voltage has not changed by more than 1 lsb (i.e., 20.0 mv @ 5.12v) from the last sampled voltage (as stated on c hold ). 134 t go q4 to a/d clock start ? t osc /2 ? ? if the a/d clock source is selected as rc, a time of t cy is added before the a/d clock starts. this allows the sleep instruction to be executed. 135 t swc switching from convert sample time 1.5 ? ? tad * these parameters are characterized but not tested. ? data in ?typ? column is at 5v, 25 c unless otherwise stated. these parameters are for design guidance only and are not tested. this specification ensured by design. note 1: adres register may be read on the following t cy cycle. 2: see section 8.1 for minimum conditions.
PIC16C433 ds41139b-page 104 preliminary ? 2002 microchip technology inc. notes:
? 2002 microchip technology inc. preliminary ds41139b-page 105 PIC16C433 13.0 dc and ac characteristics - the graphs and tables provided in this section are for design guidance and are not tested. in some graphs or tables, the data presented are outside specified operat- ing range (i.e., outside specified v dd range). this is for information only and devices will operate properly only within the specified range. the data presented in this section is a statistical sum- mary of data collected on units from different lots over a period of time. ?typical? represents the mean of the distribution while ?max? or ?min? represents (mean + 3 ) and (mean ? 3 ) respectively, where is standard deviation. figure 13-1: calibrated internal rc frequency range vs. temperature (v dd = 5.0v) (internal rc is calibrated to 25c, 5.0v) figure 13-2: calibrated internal rc frequency range vs. temperature (v dd = 2.5v) (internal rc is calibrated to 25c, 5.0v) 4.40 4.30 4.20 4.10 4.00 3.90 3.80 3.70 3.60 3.50 -40 25 85 125 4.50 0 max. min. frequency (mhz) temperature (degree c) 4.40 4.30 4.20 4.10 4.00 3.90 3.80 3.70 3.60 3.50 -40 25 85 125 4.50 0 max. min . frequency (mhz) temperature (degree c)
PIC16C433 ds41139b-page 106 preliminary ? 2002 microchip technology inc. table 13-1: dynamic i dd (typical) - wdt enabled, 25c figure 13-3: wdt timer timeout period vs. v dd figure 13-4: i oh vs. v oh , v dd = 2.5v oscillator frequency v dd = 2.5v v dd = 5.5v external rc 4 mhz 400 a* 900 a* internal rc 4 mhz 400 a 900 a xt 4 mhz 400 a 900 a lp 32 khz 15 a60 a *does not include current through external r&c. min ?40 c typ +25 c max +85 c max +125 c 55 50 45 40 35 30 25 20 15 10 0 2.5 3.5 4.5 5.5 6.5 v dd (volts) wdt period (ms) max -40 c typ +25 c min +85 c min +125 c v oh (volts) i oh (ma) .5 1.0 1.5 2.0 2.5 -0 -1 -2 -3 -4 -5 -10 2.25 1.75 1.25 .75 -6 -7 -8 -9
? 2002 microchip technology inc. preliminary ds41139b-page 107 PIC16C433 figure 13-5: i oh vs. v oh , v dd = 3.5v figure 13-6: i oh vs. v oh , v dd = 5.5v figure 13-7: i ol vs. v ol , v dd = 2.5v v oh (volts) i oh (ma) 1.5 2.0 2.5 3.0 3.5 0 -5 -10 -15 -20 -25 min +125 c min +85 c typ +25 c max -40 c 3.5 4.0 4.5 v oh (volts) i oh (ma) 5.0 5.5 0 -5 -10 -15 -20 -25 -30 m i n + 12 5 c m a x ? 4 0 c ty p + 25 c m i n + 8 5 c -35 -40 min +125 c min +85 c typ +25 c max -40 c 25 20 15 10 5 0 0.5 0.75 1.0 v ol (volts) i ol (ma) 0 30 35 0.25
PIC16C433 ds41139b-page 108 preliminary ? 2002 microchip technology inc. figure 13-8: i ol vs. v ol , v dd = 3.5v figure 13-9: i ol vs. v ol , v dd = 5.5v min +125 c min +85 c typ +25 c max -40 c 30 25 20 15 10 0 0.5 0.75 1.0 v ol (volts) i ol (ma) 0 35 40 0.25 45 min +125 c min +85 c typ +25 c max -40 c 30 25 20 15 10 0 0.5 0.75 1.0 v ol (volts) i ol (ma) 0 35 40 0.25 45 50 55
? 2002 microchip technology inc. preliminary ds41139b-page 109 PIC16C433 figure 13-10: v th (input threshold voltage) of gpio pins vs. v dd figure 13-11: v il , v ih of nmclr and t0cki vs. v dd typ +25 max -40 to +125 min -40 to +125 1.6 1.4 1.2 1.0 0.8 0.6 0 2.5 3.5 4.5 5.5 v dd (volts) v th (volts) 1.8 3.5 3.0 2.5 2.0 1.5 1.0 0.5 2.5 3.5 4.5 5.5 v dd (volts) v il , v ih (volts) v ih max (-40 to +125 ) v ih typ (+25 ) v ih min (-40 to +125 ) v ih max (-40 to +125 ) v ih typ (+25 ) v ih min (-40 to +125 )
PIC16C433 ds41139b-page 110 preliminary ? 2002 microchip technology inc. figure 13-12: lin transceiver shutdown hysteresis (v) vs. temperature ( c) 20 18 16 14 12 10 8 6 4 2 0 115 120 125 130 135 140 145 150 155 vlin (v) v bat = 18.0v v dd = 5.0v txd = 0v temp (shutdown) temp (recover) temperature ( c) 120 135.2 143.1 135.2 143.1 150.0
? 2002 microchip technology inc. preliminary ds41139b-page 111 PIC16C433 14.0 packaging information 14.1 package marking information xxxxxxxx xxxxxxxx yywwnnn 18-lead cerdip windowed 18-lead soic (.300") xxxxxxxxxxxx yywwnnn xxxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx yywwnnn 18-lead pdip example example example -i/p423 0007cdk -i/so218 0007cdk 18-lead cerdip windowed 16c433 /jw 0007cba legend: xx...x customer specific information* y year code (last digit of calendar year) yy year code (last 2 digits of calendar year) ww week code (week of january 1 is week ?01?) nnn alphanumeric traceability code note : in the event the full microchip part number cannot be marked on one line, it will be carried over to the next line thus limiting the number of available characters for customer specific information. * standard picmicro device marking consists of microchip part number, year code, week code, and traceability code. for picmicro device marking beyond this, certain price adders apply. please check with your microchip sales office. for qtp devices, any special marking adders are included in qtp price.
PIC16C433 ds41139b-page 112 preliminary ? 2002 microchip technology inc. 18-lead plastic dual in-line (p) ? 300 mil (pdip) 15 10 5 15 10 5 mold draft angle bottom 15 10 5 15 10 5 mold draft angle top 10.92 9.40 7.87 .430 .370 .310 eb overall row spacing 0.56 0.46 0.36 .022 .018 .014 b lower lead width 1.78 1.46 1.14 .070 .058 .045 b1 upper lead width 0.38 0.29 0.20 .015 .012 .008 c lead thickness 3.43 3.30 3.18 .135 .130 .125 l tip to seating plane 22.99 22.80 22.61 .905 .898 .890 d overall length 6.60 6.35 6.10 .260 .250 .240 e1 molded package width 8.26 7.94 7.62 .325 .313 .300 e shoulder to shoulder width 0.38 .015 a1 base to seating plane 3.68 3.30 2.92 .145 .130 .115 a2 molded package thickness 4.32 3.94 3.56 .170 .155 .140 a top to seating plane 2.54 .100 p pitch 18 18 n number of pins max nom min max nom min dimension limits millimeters inches* units 1 2 d n e1 c eb e p a2 l b1 b a a1 * controlling parameter notes: dimensions d and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed .010? (0.254mm) per side. jedec equivalent: ms-001 drawing no. c04-007 significant characteristic
? 2002 microchip technology inc. preliminary ds41139b-page 113 PIC16C433 18-lead plastic small outline (so) ? wide, 300 mil (soic) foot angle f 048048 15 12 0 15 12 0 mold draft angle bottom 15 12 0 15 12 0 mold draft angle top 0.51 0.42 0.36 .020 .017 .014 b lead width 0.30 0.27 0.23 .012 .011 .009 c lead thickness 1.27 0.84 0.41 .050 .033 .016 l foot length 0.74 0.50 0.25 .029 .020 .010 h chamfer distance 11.73 11.53 11.33 .462 .454 .446 d overall length 7.59 7.49 7.39 .299 .295 .291 e1 molded package width 10.67 10.34 10.01 .420 .407 .394 e overall width 0.30 0.20 0.10 .012 .008 .004 a1 standoff 2.39 2.31 2.24 .094 .091 .088 a2 molded package thickness 2.64 2.50 2.36 .104 .099 .093 a overall height 1.27 .050 p pitch 18 18 n number of pins max nom min max nom min dimension limits millimeters inches* units l c h 45 1 2 d p n b e1 e a2 a1 a * controlling parameter notes: dimensions d and e1 do not include mold flash or protrusions. mold flash or protrusions shall not exceed .010? (0.254mm) per side. jedec equivalent: ms-013 drawing no. c04-051 significant characteristic
PIC16C433 ds41139b-page 114 preliminary ? 2002 microchip technology inc. 18-lead ceramic dual in-line with window (jw) ? 300 mil (cerdip) 3.30 3.56 3.81 5.33 5.08 4.83 .210 .200 .190 w2 window length .150 .140 .130 w1 window width 10.80 9.78 8.76 .425 .385 .345 eb overall row spacing 0.53 0.47 0.41 .021 .019 .016 b lower lead width 1.52 1.40 1.27 .060 .055 .050 b1 upper lead width 0.30 0.25 0.20 .012 .010 .008 c lead thickness 3.81 3.49 3.18 .150 .138 .125 l tip to seating plane 23.37 22.86 22.35 .920 .900 .880 d overall length 7.49 7.37 7.24 .295 .290 .285 e1 ceramic pkg. width 8.26 7.94 7.62 .325 .313 .300 e shoulder to shoulder width 0.76 0.57 0.38 .030 .023 .015 a1 standoff 4.19 4.06 3.94 .165 .160 .155 a2 ceramic package height 4.95 4.64 4.32 .195 .183 .170 a top to seating plane 2.54 .100 p pitch 18 18 n number of pins max nom min max nom min dimension limits millimeters inches* units 1 2 d n w2 e1 w1 c eb e p l a2 b b1 a a1 * controlling parameter significant characteristic jedec equivalent: mo-036 drawing no. c04-010
? 2002 microchip technology inc. preliminary ds41139b-page 115 PIC16C433 appendix a: compatibility to convert code written for pic16c5x to PIC16C433, the user should take the following steps: 1. remove any program memory page select operations (pa2, pa1, pa0 bits) for call , goto . 2. revisit any computed jump operations (write to pc or add to pc, etc.) to make sure page bits are set properly under the new scheme. 3. eliminate any data memory page switching. redefine data variables to reallocate them. 4. verify all writes to status, option, and fsr registers since these have changed. 5. change reset vector to 0000h.
PIC16C433 ds41139b-page 116 preliminary ? 2002 microchip technology inc. notes:
? 2002 microchip technology inc. preliminary ds41139b-page 117 PIC16C433 index a a/d accuracy/error ........................................................... 49 adcon0 register ..................................................... 43 adif bit ...................................................................... 45 analog input model block diagram ........................... 46 analog-to-digital converter ....................................... 43 configuring analog port pins .................................... 47 configuring the interrupt ............................................ 45 configuring the module ............................................. 45 connection considerations ....................................... 49 conversion clock ...................................................... 47 conversions ............................................................... 48 converter characteristics ........................................ 102 delays ........................................................................ 46 effects of a reset .................................................... 49 equations ................................................................... 46 flowchart of a/d operation ....................................... 50 go/done bit ............................................................. 45 internal sampling switch (rss) impedance ............... 46 operation during sleep ........................................... 49 sampling requirements ............................................ 46 sampling time ........................................................... 46 source impedance .................................................... 46 time delays ............................................................... 46 transfer function ...................................................... 49 addlw instruction ............................................................ 70 addwf instruction ............................................................ 70 adie bit .............................................................................. 18 adif bit .............................................................................. 19 adres register ...................................................13 , 43 , 45 alu ...................................................................................... 7 andlw instruction ............................................................ 70 andwf instruction ............................................................ 70 application notes an546 ........................................................................ 43 an556 ........................................................................ 22 architecture harvard ........................................................................ 7 overview ...................................................................... 7 von neumann .............................................................. 7 assembler mpasm assembler ................................................... 81 b bcf instruction .................................................................. 71 bit manipulation ................................................................. 68 block diagrams analog input model .................................................... 46 on-chip reset circuit ................................................ 55 timer0 ....................................................................... 37 timer0/wdt prescaler .............................................. 40 watchdog timer ........................................................ 64 bsf instruction .................................................................. 71 btfsc instruction ............................................................. 71 btfss instruction .............................................................. 72 c c bit ................................................................................... 15 cal0 bit ............................................................................. 21 cal1 bit ............................................................................. 21 cal2 bit ............................................................................. 21 cal3 bit ............................................................................. 21 calfst bit ........................................................................ 21 call instruction ................................................................ 72 calslw bit ....................................................................... 21 carry bit ............................................................................... 7 clocking scheme .............................................................. 10 clrf instruction ............................................................... 72 clrw instruction .............................................................. 72 clrwdt instruction ......................................................... 73 code examples changing prescaler (timer0 to wdt) ....................... 41 changing prescaler (wdt to timer0) ....................... 41 indirect addressing ................................................... 23 code protection ...........................................................51 , 66 comf instruction .............................................................. 73 computed goto .............................................................. 22 configuration bits .............................................................. 51 d dc and ac characteristics ............................................. 105 dc bit ................................................................................ 15 dc characteristics PIC16C433 ................................................................ 89 decf instruction ............................................................... 73 decfsz instruction .......................................................... 73 development support ....................................................3 , 81 diagrams - see block diagrams digit carry bit ....................................................................... 7 direct addressing .............................................................. 23 e eeprom peripheral operation ......................................... 33 electrical characteristics PIC16C433 ................................................................ 87 errata ................................................................................... 2 external brown-out protection circuit ............................... 59 external power-on reset circuit ....................................... 59 f features .............................................................................. 1 fsr register ........................................................ 13 , 14 , 23 g general description ............................................................. 3 gie bit ............................................................................... 60 goto instruction .............................................................. 74 gpif bit ............................................................................. 62 gpio ...........................................................................25 , 57 gpio register ................................................................... 13 gppu bit ........................................................................... 16 i i/o interfacing .................................................................... 25 i/o ports ............................................................................ 25 i/o programming considerations ...................................... 31 id locations ...................................................................... 51 incf instruction ................................................................ 74 incfsz instruction ............................................................ 75 in-circuit serial programming .....................................51 , 66 indf register ..............................................................14 , 23 indirect addressing ............................................................ 23 initialization conditions for all registers ........................... 57 instruction cycle ................................................................ 10 instruction flow/pipelining ................................................. 10 instruction format ............................................................. 67
PIC16C433 ds41139b-page 118 preliminary ? 2002 microchip technology inc. instruction set addlw ...................................................................... 70 addwf ...................................................................... 70 andlw ...................................................................... 70 andwf ...................................................................... 70 bcf ............................................................................ 71 bsf ............................................................................ 71 btfsc ....................................................................... 71 btfss ....................................................................... 72 call .......................................................................... 72 clrf ......................................................................... 72 clrw ........................................................................ 72 clrwdt ................................................................... 73 comf ........................................................................ 73 decf ......................................................................... 73 decfsz .................................................................... 73 goto ........................................................................ 74 incf .......................................................................... 74 incfsz ...................................................................... 75 iorlw ....................................................................... 75 iorwf ....................................................................... 75 movf ........................................................................ 76 movlw ..................................................................... 75 movwf ..................................................................... 76 nop ........................................................................... 76 option ..................................................................... 76 retfie ...................................................................... 77 retlw ...................................................................... 77 return .................................................................... 77 rlf ............................................................................ 78 rrf ........................................................................... 78 sleep ....................................................................... 78 sublw ...................................................................... 79 subwf ...................................................................... 79 swapf ...................................................................... 80 tris ........................................................................... 80 xorlw ...................................................................... 80 xorwf ..................................................................... 80 section ....................................................................... 67 intcon register ............................................................... 17 intedg bit ........................................................................ 16 internal sampling switch (rss) impedance ....................... 46 interrupts ............................................................................ 51 a/d ............................................................................. 60 gp2/int ..................................................................... 60 gpio port .................................................................. 60 section ....................................................................... 60 tmr0 ......................................................................... 62 tmr0 overflow .......................................................... 60 iorlw instruction ............................................................. 75 iorwf instruction ............................................................. 75 irp bit ................................................................................ 15 l lin hardware interface ...................................................... 33 lin interfacing ................................................................... 33 lin protocol ....................................................................... 33 loading of pc .................................................................... 22 m mclr .......................................................................... 54 , 57 memory data memory ............................................................. 11 program memory ....................................................... 11 register file map PIC16C433 ........................................................ 12 movf instruction .............................................................. 76 movlw instruction ........................................................... 75 movwf instruction ........................................................... 76 mplab c17 and mplab c18 c compilers ...................... 82 mplab icd in-circuit debugger ....................................... 83 mplab ice high performance universal in-circuit emulator with mplab ide ................................................................ 83 mplab integrated development environment software .. 81 mplink object linker/mplib object librarian ................. 82 n nop instruction ................................................................. 76 o opcode .............................................................................. 67 option instruction ........................................................... 76 option register .............................................................. 16 orthogonal ........................................................................... 7 osc selection ................................................................... 51 osccal register ............................................................. 21 oscillator extrc ...................................................................... 56 hs ............................................................................. 56 intrc ....................................................................... 56 lp .............................................................................. 56 xt .............................................................................. 56 oscillator configurations ................................................... 52 oscillator types extrc ...................................................................... 52 hs ............................................................................. 52 intrc ....................................................................... 52 lp .............................................................................. 52 xt .............................................................................. 52 p packaging information ..................................................... 111 paging, program memory ................................................. 22 pcl ................................................................................... 68 pcl register ........................................................ 13 , 14 , 22 pclath ............................................................................ 57 pclath register ................................................. 13 , 14 , 22 pcon register ............................................................20 , 56 pd bit ...........................................................................15 , 54 picdem 1 low cost picmicro demonstration board ....... 84 picdem 17 demonstration board .................................... 84 picdem 2 low cost pic16cxx demonstration board .... 84 picstart plus entry level development programmer .. 83 pie1 register .................................................................... 18 pinout description PIC16C433 .................................................................. 9 pir1 register .................................................................... 19 pop ................................................................................... 22 por ................................................................................... 56 oscillator start-up timer (ost) ...........................51 , 56 power control register (pcon) ............................... 56 power-on reset (por) ................................ 51 , 56 , 57 power-up timer (pwrt) .....................................51 , 56 power-up-timer (pwrt) ........................................... 56 time-out sequence ................................................... 56 time-out sequence on power-up .............................. 58 to ............................................................................. 54 power ................................................................................ 54 power-down mode (sleep) ............................................. 64 power-on reset (por) time-out (to bit) ....................................................... 15 prescaler, switching between timer0 and wdt .............. 41
? 2002 microchip technology inc. preliminary ds41139b-page 119 PIC16C433 pro mate ii universal device programmer .................... 83 program branches ............................................................... 7 program memory paging ....................................................................... 22 program verification .......................................................... 66 ps0 bit ............................................................................... 16 ps1 bit ............................................................................... 16 ps2 bit ............................................................................... 16 psa bit ............................................................................... 16 push ................................................................................. 22 r rc oscillator ...................................................................... 53 read modify write ............................................................. 31 read-modify-write ............................................................. 31 register file ....................................................................... 11 registers map PIC16C433 ........................................................ 12 reset conditions ..................................................... 57 reset ........................................................................ 51 , 54 reset conditions for special registers ........................... 57 retfie instruction ............................................................ 77 retlw instruction ............................................................. 77 return instruction .......................................................... 77 rlf instruction .................................................................. 78 rp0 bit ........................................................................ 11 , 15 rp1 bit ............................................................................... 15 rrf instruction .................................................................. 78 s services one-time-programmable (otp) ................................. 5 quick-turnaround-production (qtp) .......................... 5 serialized quick-turnaround production (sqtp) ....... 5 sfr .................................................................................... 68 sfr as source/destination ............................................... 68 sleep ........................................................................ 51 , 54 sleep instruction .............................................................. 78 software simulator (mplab sim) ..................................... 82 special features of the cpu ............................................. 51 special function register PIC16C433 ................................................................ 13 special function registers ................................................ 68 special function registers, section .................................. 12 stack .................................................................................. 22 overflows ................................................................... 22 underflow .................................................................. 22 status register .............................................................. 15 dc bit ................................................................. 15 , 43 irp bit ..........................................................15 , 43 , 44 to bit ........................................................................ 15 z bit .................................................................... 15 , 43 sublw instruction ............................................................ 79 subwf instruction ............................................................ 79 swapf instruction ............................................................ 80 t t0cs bit ............................................................................. 16 t ad ..................................................................................... 47 thermal shut-down ........................................................... 34 timer0 rtcc ......................................................................... 57 timers timer0 block diagram ................................................... 37 external clock ................................................... 39 external clock timing ....................................... 39 increment delay ................................................ 39 interrupt ............................................................. 37 interrupt timing ................................................. 38 prescaler ........................................................... 40 prescaler block diagram ................................... 40 section .............................................................. 37 switching prescaler assignment ....................... 41 synchronization ................................................. 39 t0cki ................................................................ 39 t0if ................................................................... 62 timing ............................................................... 37 tmr0 interrupt .................................................. 62 timing diagrams a/d conversion ....................................................... 103 clkout and i/o ....................................................... 96 external clock timing ............................................... 94 time-out sequence ................................................... 58 timer0 ....................................................................... 37 timer0 interrupt timing ............................................. 38 timer0 with external clock ....................................... 39 wake-up from sleep via interrupt ........................... 65 to bit ................................................................................. 15 tose bit ............................................................................ 16 tris instruction ................................................................. 80 tris register ....................................................... 14 , 25 , 30 two?s complement .............................................................. 7 u uv erasable devices .......................................................... 5 w w register alu ............................................................................. 7 wake-up from sleep ....................................................... 64 watchdog timer (wdt) ................................ 51 , 54 , 57 , 63 wdt .................................................................................. 57 block diagram ........................................................... 64 period ........................................................................ 63 programming considerations .................................... 63 timeout ..................................................................... 57 www, on-line support ...................................................... 2 x xorlw instruction ............................................................ 80 xorwf instruction ........................................................... 80 z z bit ................................................................................... 15 zero bit ................................................................................ 7
PIC16C433 ds41139b-page 120 preliminary ? 2002 microchip technology inc. notes:
? 2002 microchip technology inc. preliminary ds41139b-page121 PIC16C433 systems information and upgrade hot line the systems information and upgrade line provides system users a listing of the latest versions of all of microchip's development systems software products. plus, this line provides information on how customers can receive the most current upgrade kits.the hot line numbers are: 1-800-755-2345 for u.s. and most of canada, and 1-480-792-7302 for the rest of the world. on-line support microchip provides on-line support on the microchip world wide web site. the web site is used by microchip as a means to make files and information easily available to customers. to view the site, the user must have access to the internet and a web browser, such as netscape ? or microsoft ? internet explorer. files are also available for ftp download from our ftp site. connecting to the microchip internet web site the microchip web site is available at the following url: www.microchip.com the file transfer site is available by using an ftp ser- vice to connect to: ftp://ftp.microchip.com the web site and file transfer site provide a variety of services. users may download files for the latest development tools, data sheets, application notes, user's guides, articles and sample programs. a vari- ety of microchip specific business information is also available, including listings of microchip sales offices, distributors and factory representatives. other data available for consideration is:  latest microchip press releases  technical support section with frequently asked questions  design tips  device errata  job postings  microchip consultant program member listing  links to other useful web sites related to microchip products  conferences for products, development systems, technical information and more  listing of seminars and events 092002
PIC16C433 ds41139b-page122 preliminary ? 2002 microchip technology inc. reader response it is our intention to provide you with the best documentation possible to ensure successful use of your microchip prod- uct. if you wish to provide your comments on organization, clarity, subject matter, and ways in which our documentation can better serve you, please fax your comments to the technical publications manager at (480) 792-4150. please list the following information, and use this outline to provide us with your comments about this document. 1. what are the best features of this document? 2. how does this document meet your hardware and software development needs? 3. do you find the organization of this document easy to follow? if not, why? 4. what additions to the document do you think would enhance the structure and subject? 5. what deletions from the document could be made without affecting the overall usefulness? 6. is there any incorrect or misleading information (what and where)? 7. how would you improve this document? to : technical publications manager re: reader response total pages sent ________ from: name company address city / state / zip / country telephone: (_______) _________ - _________ application (optional): would you like a reply? y n device: literature number: questions: fax: (______) _________ - _________ ds41139b PIC16C433
? 2002 microchip technology inc. preliminary ds41139b-page 123 PIC16C433 product identification system to order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office. * jw devices are uv erasable and can be programmed to any device configuration. jw devices meet the electrical requirement of each oscillator type. sales and support part no. x /xx xxx pattern package temperature range device device PIC16C433 PIC16C433 (tape & reel for soic only) temperature range i = -40 c to +85 c e = -40 c to +125 c package p = pdip jw* = windowed cerdip sm = soic pattern special requirements examples: a) PIC16C433-i/p = industrial temp., pdip, 4 mhz - 10 mhz, normal v dd limits b) PIC16C433-e/p = extended temp., pdip, 4 mhz - 10 mhz, normal v dd limits data sheets products supported by a preliminary data sheet may have an errata sheet describing minor operational differences and recom- mended workarounds. to determine if an errata sheet exists for a particular device, please contact one of the following: 1. your local microchip sales office 2. the microchip corporate literature center u.s. fax: (480) 792-7277 3. the microchip worldwide site (www.microchip.com) please specify which device, revision of silicon and data sheet (include literature #) you are using. new customer notification system register on our web site (www.microchip.com/cn) to receive the most current information on our products.
ds41139b-page 124 preliminary ? 2002 microchip technology inc. americas corporate office 2355 west chandler blvd. chandler, az 85224-6199 tel: 480-792-7200 fax: 480-792-7277 technical support: 480-792-7627 web address: http://www.microchip.com rocky mountain 2355 west chandler blvd. chandler, az 85224-6199 tel: 480-792-7966 fax: 480-792-4338 atlanta 3780 mansell road, suite 130 alpharetta, ga 30022 tel: 770-640-0034 fax: 770-640-0307 boston 2 lan drive, suite 120 westford, ma 01886 tel: 978-692-3848 fax: 978-692-3821 chicago 333 pierce road, suite 180 itasca, il 60143 tel: 630-285-0071 fax: 630-285-0075 dallas 4570 westgrove drive, suite 160 addison, tx 75001 tel: 972-818-7423 fax: 972-818-2924 detroit tri-atria office building 32255 northwestern highway, suite 190 farmington hills, mi 48334 tel: 248-538-2250 fax: 248-538-2260 kokomo 2767 s. albright road kokomo, indiana 46902 tel: 765-864-8360 fax: 765-864-8387 los angeles 18201 von karman, suite 1090 irvine, ca 92612 tel: 949-263-1888 fax: 949-263-1338 san jose microchip technology inc. 2107 north first street, suite 590 san jose, ca 95131 tel: 408-436-7950 fax: 408-436-7955 toronto 6285 northam drive, suite 108 mississauga, ontario l4v 1x5, canada tel: 905-673-0699 fax: 905-673-6509 asia/pacific australia microchip technology australia pty ltd suite 22, 41 rawson street epping 2121, nsw australia tel: 61-2-9868-6733 fax: 61-2-9868-6755 china - beijing microchip technology consulting (shanghai) co., ltd., beijing liaison office unit 915 bei hai wan tai bldg. no. 6 chaoyangmen beidajie beijing, 100027, no. china tel: 86-10-85282100 fax: 86-10-85282104 china - chengdu microchip technology consulting (shanghai) co., ltd., chengdu liaison office rm. 2401-2402, 24th floor, ming xing financial tower no. 88 tidu street chengdu 610016, china tel: 86-28-86766200 fax: 86-28-86766599 china - fuzhou microchip technology consulting (shanghai) co., ltd., fuzhou liaison office unit 28f, world trade plaza no. 71 wusi road fuzhou 350001, china tel: 86-591-7503506 fax: 86-591-7503521 china - hong kong sar microchip technology hongkong ltd. unit 901-6, tower 2, metroplaza 223 hing fong road kwai fong, n.t., hong kong tel: 852-2401-1200 fax: 852-2401-3431 china - shanghai microchip technology consulting (shanghai) co., ltd. room 701, bldg. b far east international plaza no. 317 xian xia road shanghai, 200051 tel: 86-21-6275-5700 fax: 86-21-6275-5060 china - shenzhen microchip technology consulting (shanghai) co., ltd., shenzhen liaison office rm. 1812, 18/f, building a, united plaza no. 5022 binhe road, futian district shenzhen 518033, china tel: 86-755-82901380 fax: 86-755-82966626 china - qingdao rm. b503, fullhope plaza, no. 12 hong kong central rd. qingdao 266071, china tel: 86-532-5027355 fax: 86-532-5027205 india microchip technology inc. india liaison office divyasree chambers 1 floor, wing a (a3/a4) no. 11, o?shaugnessey road bangalore, 560 025, india tel: 91-80-2290061 fax: 91-80-2290062 japan microchip technology japan k.k. benex s-1 6f 3-18-20, shinyokohama kohoku-ku, yokohama-shi kanagawa, 222-0033, japan tel: 81-45-471- 6166 fax: 81-45-471-6122 korea microchip technology korea 168-1, youngbo bldg. 3 floor samsung-dong, kangnam-ku seoul, korea 135-882 tel: 82-2-554-7200 fax: 82-2-558-5934 singapore microchip technology singapore pte ltd. 200 middle road #07-02 prime centre singapore, 188980 tel: 65-6334-8870 fax: 65-6334-8850 taiwan microchip technology (barbados) inc., taiwan branch 11f-3, no. 207 tung hua north road taipei, 105, taiwan tel: 886-2-2717-7175 fax: 886-2-2545-0139 europe austria microchip technology austria gmbh durisolstrasse 2 a-4600 wels austria tel: 43-7242-2244-399 fax: 43-7242-2244-393 denmark microchip technology nordic aps regus business centre lautrup hoj 1-3 ballerup dk-2750 denmark tel: 45 4420 9895 fax: 45 4420 9910 france microchip technology sarl parc d?activite du moulin de massy 43 rue du saule trapu batiment a - ler etage 91300 massy, france tel: 33-1-69-53-63-20 fax: 33-1-69-30-90-79 germany microchip technology gmbh steinheilstrasse 10 d-85737 ismaning, germany tel: 49-89-627-144 0 fax: 49-89-627-144-44 italy microchip technology srl centro direzionale colleoni palazzo taurus 1 v. le colleoni 1 20041 agrate brianza milan, italy tel: 39-039-65791-1 fax: 39-039-6899883 united kingdom microchip ltd. 505 eskdale road winnersh triangle wokingham berkshire, england rg41 5tu tel: 44 118 921 5869 fax: 44-118 921-5820 12/05/02 w orldwide s ales and s ervice


▲Up To Search▲   

 
Price & Availability of PIC16C433

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X